Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Humanoid Change State Server-Script Does not work?

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

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

1 comment

0

what?

This discussion is preserved as it was. New answers, comments, and votes are closed.