CST1229
back after too much time
So I'm trying to make a Lua script that accesses flags from the player.
However I don't know how to separate a single flag from the 1 big number that the flag userdata values provide.
I may be handling userdata structures wrong as well.
Here is my code so far:
Can someone please tell me how to separate a flag bit from a variable?
However I don't know how to separate a single flag from the 1 big number that the flag userdata values provide.
I may be handling userdata structures wrong as well.
Here is my code so far:
Code:
local function reverseGoop(p)
if (p.mo.eflags|MFE_GOOWATER == true) then
p.mo.eflags = p.mo.eflags - MFE_GOOWATER
print("In goop!")
end
end
addHook("PlayerThink", reverseGoop, MT_PLAYER)