What i am trying to do is, when the player selects the red team, it changes the value of intValue teamPicked to 1, and stringValue of TEAM to "blue", the error im getting is attempt to index nil with 'WaitForChild', ive also tried not using waitforchild and some other ways but it still did not work. I apologize if there is not enough information, but this is all i have so far:
local player = game.Players.LocalPlayer
local plr = script.Parent.Parent.Parent.Parent.Name
local playerInfo = game.Players.LocalPlayer:WaitForChild("playerInfo") --<
local teamPicked = player.playerInfo:WaitForChild("teamPicked")
script.Parent.MouseButton1Click:connect(function()
game.Players[plr].Team = game.Teams.Blue
game.Players[plr].TeamColor = BrickColor.new("Lapis")
script.Parent.Parent.Enabled = false -- the whole screenGui
teamPicked.Value = 1 -- intValue
game.ReplicatedStorage.TEAM = "blue" -- this is a stringValue
end)
the problem is in row 3

2 comments
What line is the error message on?
oh i just saw the last line of the question srry