when i used this in game instead of Sonic using it tails did (help modding)

redhot69

amongus
addHook("PlayerThink", function(p)
if p.mo.skin == "sonic" then return end -- Only apply to Sonic
if (p.cmd.buttons & BT_JUMP) -- if jump is pressed
and (p.mo.state == S_PLAY_JUMP) -- ensure Sonic is in jump state
then
p.mo.state = S_PLAY_SPRING
S_StartSound(p.mo, sfx_s3k75)
local boost = 5 * FRACUNIT
local upwardBoost = 6 * FRACUNIT
local angle = p.mo.angle
p.mo.momx = p.mo.momx + FixedMul(boost, cos(angle))
p.mo.momy = p.mo.momy + FixedMul(boost, sin(angle))
p.mo.momz = p.mo.momz + upwardBoost
end
end)
 
addHook("PlayerThink", function(p)
if p.mo.skin == "sonic" then return end -- Only apply to Sonic
if (p.cmd.buttons & BT_JUMP) -- if jump is pressed
and (p.mo.state == S_PLAY_JUMP) -- ensure Sonic is in jump state
then
p.mo.state = S_PLAY_SPRING
S_StartSound(p.mo, sfx_s3k75)
local boost = 5 * FRACUNIT
local upwardBoost = 6 * FRACUNIT
local angle = p.mo.angle
p.mo.momx = p.mo.momx + FixedMul(boost, cos(angle))
p.mo.momy = p.mo.momy + FixedMul(boost, sin(angle))
p.mo.momz = p.mo.momz + upwardBoost
end
end)
Seeing the code, I can notice not only Tails, but any character except Sonic can use it.

Try replacing if p.mo.skin == "sonic" with if p.mo.skin != "sonic" to make it Sonic-only.
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top