I have 2 bricks, one for the red team, and one for the blue team. Once they touch their own team's territory, i have a tag that says that it is touching their brick. Here's the code:
Player = script.Parent
tag = Player:WaitForChild("Team")
tag2 = Player:WaitForChild("IsDominating")
Torso = Player:WaitForChild("Torso")
function CheckIfDominating(Part)
if tag.Value == ("Bright red") then
if Part.Name == ("RedTeamControlled") then
tag2.Value = true
elseif Part.Name == ("BlueTeamControlled") then
tag2.Value = false
end
elseif tag.Value == ("Bright blue") then
if Part.Name == ("RedTeamControlled") then
tag2.Value = false
elseif Part.Name == ("BlueTeamControlled") then
tag2.Value = true
end
end
end
Torso.Touched:connect(CheckIfDominating())
I have no idea whats wrong. When ever i switch bricks it says "attempt to call a nil value". it does not say what is nil. it also says Attempt to connect failed: Passed value is not a function Script 'Workspace.Player1.Checker', Line 23
Thank you
