#Player still Jumping

23 messages · Page 1 of 1 (latest)

jade slate
#
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        character:WaitForChild("Humanoid")
        character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)
    end)
end)

why is my dude still jumping (ServerScriptService, Normal Script)

#

ohh

#

well thats not good

ripe cairn
#

You're setting this from the server?

jade slate
#

chatgpt said ur right 💀

ripe cairn
#

ChatGPT never knows what it's talking about

jade slate
#

nah fr

#

yea

ripe cairn
jade slate
#

serverscriptservice

ripe cairn
#

You've got to disable the state on the client

jade slate
#

so localscript

#

and the code is correct?

ripe cairn
#

You cannot use that code in a LocalScript

jade slate
#

oh god

ripe cairn
#
local humanoid = script.Parent:WaitForChild("Humanoid")
humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false)

LocalScript in StarterCharacterScripts

jade slate
#

ty bro

#

it works

#

but why am I not able to put my script in a LocalScript?

#

caus PlayerAdded runs on the Server?

#

@ripe cairn 🥹

ripe cairn
# jade slate caus PlayerAdded runs on the Server?

LocalScripts are downloaded by the client. This requires them to be connected to the game server. Once the code runs, do you think Players.PlayerAdded will fire if the player had already been connected to the game server? 👀

jade slate
#

No I do not think so 👀