chipakpaka
Member
last month i posted a thread about replicating the vanilla's melee in lua, but then changed my mind because i thought i could figure it out myself. anyway, i kinda forgot about it until today, and i came up with a code that kinda works, but also has a lot of problems.
here's the code:
my first problem is that the ability works while the character is also in the air, and it shouldn't do that.
my second problem is that the ability works when holding the spin key, when it should only work when the key is just pressed.
here's the code:
Lua:
addHook("SpinSpecial", function()
for p in players.iterate
if p.mo.skin == "idk"
if p.cmd.buttons & BT_SPIN
and P_IsObjectOnGround then
P_Thrust(p.mo, p.mo.angle, p.maxdash)
P_SetObjectMomZ(p.mo, p.mindash, true)
p.mo.state = S_PLAY_ROLL
p.powers[pw_strong] = STR_MELEE
end
end
end
end)
my first problem is that the ability works while the character is also in the air, and it shouldn't do that.
my second problem is that the ability works when holding the spin key, when it should only work when the key is just pressed.