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

How do I teleport Players after they click A Gui?

Asked by
tumadrina 179
10 years ago
Click.MouseButton1Down:connect(function()
    --code
end)

I know I need that much(How to make something happen when the Gui is clicked), but how do I access a Player's body part?(like torso head etc)

3 answers

Log in to vote
-2
Answered by 10 years ago
Click.MouseButton1Down:connect(function()
               for i,v in pairs(game.Players:GetPlayers()) do
             v.Character.Torso.CFrame=Workspace.tele6.CFrame + Vector3.new(0,5,0)--erase --Workspace.tele6 and put where you want them teleported
    end
end)


Ad
Log in to vote
-1
Answered by
l0cky2013 135
10 years ago

Listen for the event to fire, and then move the player's character.

LocalScript Example

local playerService=game:GetService("Players")
local player=playerService.LocalPlayer
--define click somewhere, I didn't see it in your code
Click.MouseButton1Click:connect(function()
player.Character:MoveTo(VECTOR 3 POSITION)
end) 
0
thanks tumadrina 179 — 10y
Log in to vote
-2
Answered by
Adryin 120
10 years ago

Make this a local script pl0x.


plr = game.Players.localPlayer Click.MouseButton1Click:connect(function() plr:MoveTo( WHERE TO ) end)

Answer this question