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.

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

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago
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)
0
Thanks worked pretty much perfectly other than I had to change player to plr, thanks! ElongatedMongoose 138 — 4y
Ad

Answer this question