This script should make it so that you can use a normal thok when you press the spin button after a jump and use a homing thok if you press the jump button again after jumping.
addHook("PlayerThink", function(player)
if player.mo.skin ~= "sonic" then
return
end --this stops the script if the player isn't sonic
local actionspeed = FixedMul(player.mo.scale, player.actionspd)
if (player.mo.eflags & MFE_UNDERWATER) then
actionspeed = $/2
end --this part creates a new variable that uses the skin's actionspeed and makes it work in different parts of the game where it should change
if (player.pflags & PF_JUMPED) --if the player jumped
and not (player.pflags & PF_THOKKED) --if the player didn't use their ability
and (player.cmd.buttons & BT_SPIN) then -- if the player presses the spin button
P_InstaThrust(player.mo, player.mo.angle, actionspeed) --thrust the player using the variable we created
P_SpawnThokMobj(player) --this is just for looks its spawns a thok trail
S_StartSound(player.mo, sfx_thok) --this plays the thok sound
player.pflags = $|PF_THOKKED --this makes it so the player can't use this ability or the homing thok again
end
player.charability = CA_HOMINGTHOK --this changes sonic's main ability to the homing thok
end)
I believe I could create the hyper mode, but I want to know how or when do you want it to activate?
This script should make it so that you can use a normal thok when you press the spin button after a jump and use a homing thok if you press the jump button again after jumping.
addHook("PlayerThink", function(player)
if player.mo.skin ~= "sonic" then
return
end --this stops the script if the player isn't sonic
local actionspeed = FixedMul(player.mo.scale, player.actionspd)
if (player.mo.eflags & MFE_UNDERWATER) then
actionspeed = $/2
end --this part creates a new variable that uses the skin's actionspeed and makes it work in different parts of the game where it should change
if (player.pflags & PF_JUMPED) --if the player jumped
and not (player.pflags & PF_THOKKED) --if the player didn't use their ability
and (player.cmd.buttons & BT_SPIN) then -- if the player presses the spin button
P_InstaThrust(player.mo, player.mo.angle, actionspeed) --thrust the player using the variable we created
P_SpawnThokMobj(player) --this is just for looks its spawns a thok trail
S_StartSound(player.mo, sfx_thok) --this plays the thok sound
player.pflags = $|PF_THOKKED --this makes it so the player can't use this ability or the homing thok again
end
player.charability = CA_HOMINGTHOK --this changes sonic's main ability to the homing thok
end)
I believe I could create the hyper mode, but I want to know how or when do you want it to activate?
First off thank you for this. I'll be testing this out and seeing if I can make something else out if this. Now for hyper mode, I would like to make it Sonc the Fighters, being that's you don't need any Emeralds to do so accurate so custom 1 would do. If you have all seven Emeralds, this auto super jump replaces this. But if people really like hyper mode, I would like for a command to be in place to toggle automatical super jump and hyper mode