|
| 27 Apr 2015 11:47 AM |
Hi there,
I'm looking to teleport players to another spot and after 20 seconds return the player to the same spot they were just at. Basically, I need to be able to put their location they are at (right before teleportation) as a variable.
Any help is appreciated.
Thanks :) |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Apr 2015 12:52 PM |
function teleport (torso,newpos,waitamount)
local firstpos = torso.CFrame
torso.CFrame = newpos
wait(waitamount)
torso.CFrame = firstpos
end
teleport(put the players torso here,CFrame.new(0,0,0),20)
change the CFrame.new(0,0,0) to the new position you want the player to teleport to.
|
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 01:08 PM |
function teleport (torso,newpos,waitamount)
local firstpos = torso.CFrame
torso.CFrame = newpos
wait(20)
torso.CFrame = firstpos
end
teleport(game.Players:FindFirstChild(script.Parent.KickeeName.Value).torso,CFrame.new(0,0,0),20)
This "game.Players:FindFirstChild(script.Parent.KickeeName.Value).torso" identifies the player who needs to be teleported or in this case the torso of the player. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 01:08 PM |
| If you can confirm whether or not that's right as per your suggestion, that would be great :) |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Apr 2015 01:49 PM |
| Yes that is correct. Right now it would teleport them to 0,0,0, so make sure to change that to whatever you want. |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 01:50 PM |
OH NO WAIT
Put .Character before .torso
also change .torso to .Torso |
|
|
| Report Abuse |
|
|
|
| 27 Apr 2015 01:51 PM |
So
game.Players:FindFirstChild(script.Parent.KickeeName.Value).Character.Torso |
|
|
| Report Abuse |
|
|