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

Mini character script (OnPlayerEntered Doesnt work)?

I need this script to happen to the player every time they respawn, not just when they join.

function onPlayerEntered(player) 
    repeat wait (0.5) until player.Character ~= nil 
    player.Character.Humanoid.BodyDepthScale.Value = 0.4
    player.Character.Humanoid.BodyHeightScale.Value = 0.4
    player.Character.Humanoid.BodyWidthScale.Value = 0.4
    player.Character.Humanoid.HeadScale.Value = 1
   player.CharacterAdded:connect(function (char)     char.HeadScale.Value = 1 end) end game.Players.PlayerAdded:connect(onPlayerEntered)


I'm trying to learn how to use more regular script rather than localscripts. It's definitely more challenging.

1 answer

✓ Accepted answer
game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(player)
		player.Character.Humanoid.BodyDepthScale.Value = 0.4
 		player.Character.Humanoid.BodyHeightScale.Value = 0.4
		player.Character.Humanoid.BodyWidthScale.Value = 0.4
 		player.Character.Humanoid.HeadScale.Value = 1
		player.HeadScale.Value = 1
	end)
end)

1 comment

0

Thanks worked pretty much perfectly other than I had to change player to plr, thanks!

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