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

How to Detect and Fire Function on EVERY Character Reload?

How do I detect every time a character reloads, not just on game entry? I need to fire a function to reload a stored value every time the character respawns. All of this needs to happen locally, this is reloading a MouseIcon that the player has chosen. Thanks in advance!

1 comment

0

You can put the value inside of a ScreenGui in the StarterGui and turn ResetOnSpawn on the ScreenGui property on.

1 answer

✓ Accepted answer

First let's make the player added event

game.Players.PlayerAdded:connect(function(plr)

end)

Then lets add the characteradded event

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)

	end)
end)

Now we have an event that fires when ever that player's character respawns

game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
		print(char:WaitForChild("Humanoid").WalkSpeed)
	end)
end)

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