This script repeats itself every time the player resets, can you help explain the reason and tell me how to fix it?

local player = game.Players.LocalPlayer
wait(0.2)
if game.Players.LocalPlayer.Name == 'legoboy78123' then game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = game.Players.LocalPlayer.Character.Humanoid.WalkSpeed +8
	player.PlayerGui.BeastGui.Enabled = true
else
	player.Character.Humanoid.WalkSpeed = player.Character.Humanoid.WalkSpeed -4
	player.PlayerGui.HumanGui.Enabled = true
	game.ReplicatedStorage.PlayerMusic.Playing = true
	game.ReplicatedStorage.PlayerMusic.TimePosition = 0
end

3 comments

0

Where is this script located?

0

If it's located in a gui, make sure that 'ResetOnSpawn' is set to false

0

Just like what he said ^^^ ... Script is ran if a player spawns, so your script could be in StarterGUI, Pack, any Starter Folders.