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

StarterPack/localscript, change players properties not working, why?

Asked by 6 years ago
local playername = game.Players.LocalPlayer
local playercharacter = playername.Character

game.Workspace.playercharacter.Head.BrickColor = BrickColor.new("Lime green")

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
6 years ago

The character takes longer to load than the LocalScript, so you have to wait for it.

local plr = game.Players.LocalPlayer
local char = plr.Character or pr.CharacterAdded:Wait()
local head = char:WaitForChild("Head");

head.BrickColor = BrickColor.new("Lime green")
Note.. this is only going to happen for the person playing. Find out more here
0
Typo with plr mattscy 3725 — 6y
0
thanks matt, a great help dwanedibbley 10 — 6y
0
Thanks matt!! Goulstem 8144 — 6y
Ad

Answer this question