I'm trying to change a characters head color by teams and the script i am making
local player = game.Players.LocalPlayer
while true do
if player.Team == game:GetService("Teams").Blue then
Starter.Head.BrickColor = BrickColor.new("Really blue") else
if player.Team == game:GetService("Teams").Red then
Starter.Head.BrickColor = BrickColor.new("Really red") else
if player.Team == game:GetService("Teams").Green then
Starter.Head.BrickColor = BrickColor.new("Lime green") else
if player.Team == game:GetService("Teams").Lobby then
Starter.Head.BrickColor = BrickColor.new("Medium stone grey")
end
end
end
end
end
this is a local script because i am trying to target the player on teams so when on a team your character changes its look, in the developer console it says line 5: Attempt to index local 'player' (a nil value)

1 comment
Is that a local script or a server script?