Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Mini character script (OnPlayerEntered Doesnt work)?

Asked by 4 years ago

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

1function onPlayerEntered(player)
2    repeat wait (0.5) until player.Character ~= nil
3    player.Character.Humanoid.BodyDepthScale.Value = 0.4
4    player.Character.Humanoid.BodyHeightScale.Value = 0.4
5    player.Character.Humanoid.BodyWidthScale.Value = 0.4
6    player.Character.Humanoid.HeadScale.Value = 1
7   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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
1game.Players.PlayerAdded:Connect(function(plr)
2    plr.CharacterAdded:Connect(function(player)
3        player.Character.Humanoid.BodyDepthScale.Value = 0.4
4        player.Character.Humanoid.BodyHeightScale.Value = 0.4
5        player.Character.Humanoid.BodyWidthScale.Value = 0.4
6        player.Character.Humanoid.HeadScale.Value = 1
7        player.HeadScale.Value = 1
8    end)
9end)
0
Thanks worked pretty much perfectly other than I had to change player to plr, thanks! ElongatedMongoose 138 — 4y
Ad

Answer this question