chipakpaka
Member
i'm trying to make an ability lua that is a combination of rolling and a melee attack. here is what i made so far:
when i load it in the it doesn't show me any "warning" at first, but when i try to use the ability it shows me something about "attempt to index global 'p' (a number value)". can anyone please tell my why that is, and maybe point out other potential flaws in the code?
Lua:
addHook("SpinSpecial", function()
if p.mo.skin == "idk"
and p.cmd.buttons & BT_SPIN then
and P_IsObjectOnGround(p.mo)
if not (p.pflags == PF_SPINNING) then
p.mo.state = S_PLAY_ROLL
p.pflags = PF_SPINNING
P_InstaThrust(p.mo, p.mo.angle, p.maxdash*FRACUNIT)
p.powers[pw_strong] = STR_MELEE
end
end
end)
when i load it in the it doesn't show me any "warning" at first, but when i try to use the ability it shows me something about "attempt to index global 'p' (a number value)". can anyone please tell my why that is, and maybe point out other potential flaws in the code?