Fenastra
SRB2 Enjoyer
Hey fellas! I need some help with Lua.
For context, I've learned the basics of Lua coding, such as variables, functions and whatnot. However, SRB2's bastardized Lua is still confounding me.
I attempted to make a simple mod for Sonic that causes him to slowly float up when the Jump button is held. The ability is only meant to be usable for 100 tics, forcing Sonic to land before he can start using it again. However, Sonic seems to be able to use it indefinitely. I found that the touchedGround boolean is never false, even after 100 tics.
I'm unsure of what I'm actually doing here, so I can imagine that any part of this script is messing things up. Although, I'm confident the main issue has to do with line 7.
Can anyone tell me what's preventing this code from working as intended, and how I can fix it?
The lua is attached.
For context, I've learned the basics of Lua coding, such as variables, functions and whatnot. However, SRB2's bastardized Lua is still confounding me.
I attempted to make a simple mod for Sonic that causes him to slowly float up when the Jump button is held. The ability is only meant to be usable for 100 tics, forcing Sonic to land before he can start using it again. However, Sonic seems to be able to use it indefinitely. I found that the touchedGround boolean is never false, even after 100 tics.
I'm unsure of what I'm actually doing here, so I can imagine that any part of this script is messing things up. Although, I'm confident the main issue has to do with line 7.
Can anyone tell me what's preventing this code from working as intended, and how I can fix it?
The lua is attached.