Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make it so only 1 team can click a block and it teleports? [closed]

Asked by 6 years ago

So I need a script so that when only 1 team out of the two can click the block and it teleports.

Closed as Not Constructive by Axceed_Xlr, hellmatic, DeceptiveCaster, and Shawnyg

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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 :)

Ad