SONENEIS
Member
Hi, this Is my first post, I do not know what to do.
I'm making a code that makes the characters strong and some graphic effects once they reach a specific speed, everything is ok, but whenever I use Sonic's thok, the code checks if I collided with everything underneath him (at least I think that's it).
I do not know how to explain. You know that invincibility monitor under the bridge in the first stage? If I cross this bridge using Sonic's thok, it breaks the monitor underneath it, and does the same to anything underneath Sonic, even without colliding. what do I do?
This is my code:
I'm making a code that makes the characters strong and some graphic effects once they reach a specific speed, everything is ok, but whenever I use Sonic's thok, the code checks if I collided with everything underneath him (at least I think that's it).
I do not know how to explain. You know that invincibility monitor under the bridge in the first stage? If I cross this bridge using Sonic's thok, it breaks the monitor underneath it, and does the same to anything underneath Sonic, even without colliding. what do I do?
This is my code:
Lua:
addHook('MobjMoveCollide',function(a,b)
for player in players.iterate
a = player.mo
if player.speed > FRACUNIT*36+FRACUNIT/3 and b and b.valid and a and a.valid and not(player.pflags & PF_THOKKED and player.pflags & PF_SPINNING)
if b.flags & MF_ENEMY
P_DamageMobj(b,a,a)
elseif b.flags & MF_MONITOR or b.type == MT_SPIKE or b.type == MT_WALLSPIKE
P_KillMobj(b,a,a)
end
end
end
end)