Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Humanoid Change State Server-Script Does not work?

Asked by 2 years ago

So It's a server script and It shows no error? Code: `game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local head = character:WaitForChild("Head") local humanoid = character:WaitForChild("Humanoid")

    local StepsAmountGui = script.StepsAmount:Clone()
    local StepsGui = script.StepsGui:Clone()

    StepsAmountGui.Parent = head
    StepsGui.Parent = head

    local steps = math.random(1, 500)

    spawn(function()
        while task.wait() do
            StepsAmountGui.TextLabel.Text = steps
        end
    end)

    StepsAmountGui.TextLabel.Text = steps

    local amount = humanoid:ChangeState("Running")
    if amount >= steps then
            player:Kick("You don't have any steps left!")
        else
            steps = steps - amount
        end
end)

end)`

1 answer

Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

0
what? Pro_beatz 36 — 2y
Ad

Answer this question