Any Idea Why This Does Not Work?
LocalPlayer = game.Players.LocalPlayer Torso = game.LocalPlayer.Torso.BrickColor = ("Really red")
A better way to write this could be in many ways:
A simple one time coloring:
local player = game:GetService("Players").LocalPlayer player:WaitForChild("Character").Torso.BrickColor = BrickColor.new("Really red")
or a on join module:
local player = game:GetService("Players").LocalPlayer game:GetService("Players").PlayerAdded:connect(function() player:WaitForChild("Character").Torso.BrickColor = BrickColor.new("Really red")
or a module to change the color when it's changed:
local player = game:GetService("Players").LocalPlayer local wfc = game.WaitForChild local char = wfc(player,"Character") char:FindFirstChild("Torso").Changed:connect(function() if char.Torso.BrickColor == BrickColor.new("Really red") then --still red bro else char.Torso.BrickColor = BrickColor.new("Really red") end end)
You've made a typo. You do not need game.LocalPlayer
to direct it to the player since you've already made it local, AND there's no child of game
named LocalPlayer
. The right way to do it is just simply LocalPlayer
. Here's the fixed version
local LocalPlayer = game.Players.LocalPlayer local Torso = LocalPlayer.Character.Torso Torso.BrickColor = BrickColor.new("Really red")