Hello everyone, I have problem, becouse i want to make when team will get outpost, parts should change colors on team color.
Here is script:
local ting = 0
function OnTouch (Part)
if ting == 0 then
ting = 1
local Humanoid = Part.Parent:FindFirstChild("Humanoid")
if Humanoid then
local Player = game.Players:GetPlayerFromCharacter(Humanoid.Parent)
if Player then
script.Parent.Parent.Parent.Lights.Ball.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.Ball2.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.Ball3.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C1.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C2.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C3.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C4.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C5.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C6.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C7.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C8.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C9.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C10.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C11.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.C12.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.L1.BrickColor = Player.TeamColor
script.Parent.Parent.Parent.Lights.L2.BrickColor = Player.TeamColor
end
end
end
ting = 0
end
script.Parent.Parent.CLight.Touched:connect(OnTouch)
ting is debounce.

2 comments
Explain what's happening and what errors you are getting. All you said was you want the script to do something but you didn't explain anything else
Becouse now it make when player touch it color will change, but i want to change color when player capture outpost... i know it's probably request, but i don't know how to fix it ;/