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

One-player teleport script? [closed]

Asked by 10 years ago

So that it only teleports ONE player.

On a server with 20 people.

Closed as Not Constructive by evaera

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
Japhie 20
10 years ago

This should work if it's a button

local player = game.Players.LocalPlayer

function onClick()
    game.Workspace[player.Name].Torso.CFrame = CFrame.new(Vector3.new(0, 5, 0)) -- You can change the (0, 5, 0)) to whatever is appropriate for the teleport
end

script.Parent.MouseButton1Click:connect(onClick)

This should work only if it's a button. If you test it and it teleports all players then try putting this into a local script instead of a regular script. But it should work just fine in a regular script.

You should've explained better :/

0
No, a script. Not a button. So, after like 3 seconds, it teleports only ONE player to a certain position.. OTSorcus 0 — 10y
1
This won't work because you wrote "local" before a variable which isn't in the function. Kozero 120 — 10y
Ad