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

How do you add a spectate button? [closed]

Asked by 10 years ago

In lots of games you can spectate people. And In my game "Cake-tastrophe" I would like the person to spectate. I also need a scripter for the game. That would be cool. Thank you!

Closed as Not Constructive by Azarth and User#2

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
-2
Answered by 10 years ago
local part=PARTLOCATIONHERE --Change to where the part is where you want it to tp to
local d=false --Debounce
script.Parent.Touched:connect(function(part) --Calls event when touched
    if d then return end --Checks debounce
    d=true --Debounce
    if part.Parent:FindFirstChild("Humanoid") then --Finds a Humanoid if there is one
        part.Parent:MoveTo(part.Position) --tps character to part
    end
    d=false --Debounce
end)

If you want it to teleport when a player clicks it then edit the code

0
He said spectate, not teleport. Azarth 3141 — 10y
Ad