Hiya people!
I've been having some issues with a certain character that's been sitting in Submissions for a while now, and Judges have tried to help me with a certain glitch involving one of the character's abilites. Problem is... I am absolutely clueless when it comes to Lua, so any advices and LITERAL CORRECTIONS to the code went over my head because I just didn't understand what to do.
The following is the part of the code that should be changed:
Zipper said that I had to do the following:
Again, I just don't understand what I'm supposed to do. English isn't my main language, and Lua is something I just can't understand, so combine them and you get complete frustration and running around in circles doing nothing.
Any help will be appreciated. Many, many thanks!
hope im not breaking any rules, jeez im scared :<
I've been having some issues with a certain character that's been sitting in Submissions for a while now, and Judges have tried to help me with a certain glitch involving one of the character's abilites. Problem is... I am absolutely clueless when it comes to Lua, so any advices and LITERAL CORRECTIONS to the code went over my head because I just didn't understand what to do.
The following is the part of the code that should be changed:
Code:
addHook("MobjSpawn", function(mo) mo.dashing = 0 end, MT_PLAYER)
addHook("MobjSpawn", function(mo) mo.dashslow = 0 end, MT_PLAYER)
//Thanks to BlueBlurForever for letting me use his "Dashing" Script!
addHook("ThinkFrame", do
for player in players.iterate
if player.mo and player.mo.skin == "weavile"
and not (player.pflags & PF_NIGHTSMODE)
and (player.cmd.buttons & BT_USE)
and not (player.pflags & (PF_ROPEHANG|PF_CARRIED|PF_ITEMHANG|PF_MACESPIN))
and not (player.exiting)
and not (player.pflags & PF_TIMEOVER)
and not (player.pflags & PF_SPINNING)
and not (player.mo.state == S_PLAY_DIE)
and not (player.weapondelay)
and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
and P_IsObjectOnGround(player.mo)
and (player.mo.dashing == 0)
and (player.mo.dashslow == 0)
S_StartSound(mo, sfx_wclaw)
player.mo.state = S_PLAY_ATK1
A_Thrust(player.mo, 60, 1)
player.powers[pw_nocontrol] = 32767
player.powers[pw_invulnerability] = 25
player.mo.dashing = 1
end
if player.mo.dashing == 1
player.mo.dashing = 0
player.mo.dashslow = 1
end
if player.mo.dashslow == 1
and player.mo.momx == 0
and player.mo.momy == 0
player.powers[pw_nocontrol] = 0
player.powers[pw_invulnerability] = 0
player.mo.state = S_PLAY_RUN1
player.mo.dashslow = 0
end
if (player.mo.state == S_PLAY_SPRING) then
player.powers[pw_nocontrol] = 0
player.powers[pw_invulnerability] = 0
end
end
end)
addHook("ThinkFrame", do
for player in players.iterate
if player.mo and player.mo.skin == "weavile"
and not (player.pflags & PF_NIGHTSMODE)
player.powers[pw_underwater] = 1073741824
player.powers[pw_spacetime] = 1073741824
end
end
end)
Zipper said that I had to do the following:
Right, so:
"addHook("MobjSpawn", function(mo) mo.invuln = 0 end, MT_PLAYER)" You'll need this at the start.
This is where you'd check if player.powers[pw_invulnerability] is above 25, right before setting it. If it's above 25, skip that part, and make player.mo.invuln equal 1.
Before setting pw_invulnerability to 0, check if mo.invuln was 1 (which would mean the player was invulnerable when we started). If it's NOT 1, (they weren't invincible) set the invulnerability to 0. After that, set player.mo.invuln to 0, it's fulfilled its purpose for this check.
"addHook("MobjSpawn", function(mo) mo.invuln = 0 end, MT_PLAYER)" You'll need this at the start.
Code:
S_StartSound(mo, sfx_wclaw)
player.mo.state = S_PLAY_ATK1
A_Thrust(player.mo, 60, 1)
player.powers[pw_nocontrol] = 32767
player.powers[pw_invulnerability] = 25
player.mo.dashing = 1
This is where you'd check if player.powers[pw_invulnerability] is above 25, right before setting it. If it's above 25, skip that part, and make player.mo.invuln equal 1.
Code:
if player.mo.dashslow == 1
and player.mo.momx == 0
and player.mo.momy == 0
player.powers[pw_nocontrol] = 0
player.powers[pw_invulnerability] = 0
player.mo.state = S_PLAY_RUN1
player.mo.dashslow = 0
end
if (player.mo.state == S_PLAY_SPRING) then
player.powers[pw_nocontrol] = 0
player.powers[pw_invulnerability] = 0
end
Before setting pw_invulnerability to 0, check if mo.invuln was 1 (which would mean the player was invulnerable when we started). If it's NOT 1, (they weren't invincible) set the invulnerability to 0. After that, set player.mo.invuln to 0, it's fulfilled its purpose for this check.
Again, I just don't understand what I'm supposed to do. English isn't my main language, and Lua is something I just can't understand, so combine them and you get complete frustration and running around in circles doing nothing.
Any help will be appreciated. Many, many thanks!
hope im not breaking any rules, jeez im scared :<