How do i make an intvalue go to the players humanoid?

how can i make it so when a player joins an IntValue gets put in the plrs humanoid?
and if the players respawn the IntValue gets put in the humanoid again?

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		local humanoid = character.Humanoid
		
		local intvalue = Instance.new("IntValue")
        intvalue.Name = "IntValue"
		intvalue.Parent = humanoid
	end)
end)

where do i put this script?

in serverscriptservice?

1 Like

You would put the script in ServerScriptService since only the server is responsible for adding values to a player or player object.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.