how would a make a clickdecetor event teamlocked?
01 | local team = ( "Really red" ) |
02 | script.Parent.MouseClick:Connect( function () |
03 | if game.Players.LocalPlayer.TeamColor = = team then |
04 | script.Parent.MaxActivationDistance = 0 |
05 | script.Parent.Archivable = false |
06 | script.Parent.Parent.tnt.Transparency = 0 |
07 | script.Parent.Parent.tnt 1. Transparency = 0 |
08 | script.Parent.Parent.tnt 2. Transparency = 0 |
10 | local fire = Instance.new( "Fire" ) |
12 | fire.Parent = script.Parent.Parent.tnt |
14 | local fire 2 = Instance.new( "Fire" ) |
16 | fire 2. Parent = script.Parent.Parent.tnt 1 |
18 | local fire 2 = Instance.new( "Fire" ) |
20 | fire 2. Parent = script.Parent.Parent.tnt 2 |
23 | local explosion = Instance.new( "Explosion" ,game.Workspace) |
24 | explosion.BlastRadius = 12 |
25 | explosion.BlastPressure = 1000000 |
26 | explosion.Position = script.Parent.Parent.Position |
27 | script.Parent.Parent.Transparency = 1 |
28 | script.Parent.Parent.CanCollide = false |
29 | script.Parent.Parent.tnt.Transparency = 1 |
30 | script.Parent.Parent.tnt 1. Transparency = 1 |
31 | script.Parent.Parent.tnt 2. Transparency = 1 |
33 | script.Parent.Parent.tnt.Fire:Destroy() |
34 | script.Parent.Parent.tnt 1. Fire:Destroy() |
35 | script.Parent.Parent.tnt 2. Fire:Destroy() |
Sorry for the bad formatting I dont get an output error but the script won't work I made sure I was in the right team