Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how to make it so only one team can click a block and it teleports?

Hey! I have no clue how to do this! so let me explain I want to make it so only 1 team can click the block and when that team does it teleports to certain place.

1 comment

0

Please refer to the wiki for basic scripting lessons. You would be looking for things like Click detectors, CFraming, and teamColors.

1 answer

You would need to do something similar to:

local part = script.Parent -- Defining the part the player clicks on
local clickDetector = Instance.new("ClickDetector", part) -- Creating a ClickDetector inside the part
local teleportToPosition = CFrame.new(10,1,1) -- Where the character teleport to

clickDetector.MouseClick:connect(function(player) -- When player clicks the part
	if player.TeamColor == BrickColor.new("Really red") then -- Change "Really red" to the BrickColor value of the team you want to be able to teleport	
		player.Character.HumanoidRootPart.CFrame = teleportToPosition -- Teleports player
	end
end)

This script will check what team a player is on when they press the button and teleport that player if they are on the right team.

Hope this helps.

This discussion is preserved as it was. New answers, comments, and votes are closed.