So I need a script so that when only 1 team out of the two can click the block and it teleports.
COMMUNITY QUESTION
How do I make it so only 1 team can click a block and it teleports?
1 answer
So you're trying to make a team only teleport part (clickdetector)?
local CD = script.Parent -- ClickDetector
CD.MouseClick:Connect(function(plr) -- Event
if plr and plr.Team == game.Teams.Red then -- Check the player's team
local char = plr.Character or plr.CharacterAdded:Wait() -- Get the character
local HRP = char:WaitForChild('HumanoidRootPart') -- Get the HRP
HRP.CFrame = CFrame.new(0,10,0) -- Position in CFrame
end
end)
You can use game.Teams.Red or any teamNAME or use the teamcolor
If you have any more questions, just ask :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
