Team only Click Detector

local ClickDetector = script.Parent

ClickDetector.MouseClick:Connect(function(player)
if player. TeamColor = BrickColor.new(151, 0, 0) then
end
end)

This is my current script, the Team colour is Crimson and thats the Colour code for Crimson in roblox. And it does not work.

This should work:

local ClickDetector = script.Parent --The ClickDetector
local AllowedTeam = game.Teams.AllowedTeam --Direction to the Team which is allowed

ClickDetector.MouseClick:Connect(function(Player)
	
	if Player.Team == AllowedTeam then
		
		--Whatever you want to happen if the player clicks and is in the team
		
	end
	
end)

Make sure its an normal Script, not an Module or Local Script

Wdym Direction to the team?

make sure the Team is in the Team Folder

so the line should look like that (Example):

local AllowedTeam = game.Teams.YourTeamNameHere

So put the script you said in ClickDetector?

yes, create an Script in ClickDetector (a normal Script) and change the Variables and put your Script what should happen in the Line marked with “Whatever you want to happen if the player…”

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.