generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Teleport on touch

Previous Thread :: Next Thread 
VoidThrash is not online. VoidThrash
Joined: 05 Jan 2013
Total Posts: 25
06 Jan 2013 08:54 AM
How would i do this?

function tele(hit)

end
script.Parent.Touched:connect(tele)
Report Abuse
VoidThrash is not online. VoidThrash
Joined: 05 Jan 2013
Total Posts: 25
06 Jan 2013 08:57 AM
Bump.
Report Abuse
VoidThrash is not online. VoidThrash
Joined: 05 Jan 2013
Total Posts: 25
06 Jan 2013 08:59 AM
Bumpitybump.
Report Abuse
centraltrains is online. centraltrains
Joined: 18 May 2010
Total Posts: 1331
06 Jan 2013 09:04 AM
You have to make a script to move the players torso.
Report Abuse
Luc599345 is not online. Luc599345
Joined: 25 Jul 2008
Total Posts: 1169
06 Jan 2013 10:03 AM
function tele(hit)
local char = hit.Parent
local pyr = game:service'Players':GetPlayerFromCharacter(char)
if pyr and char and char:FindFirstChild("Torso") then
char.Torso.CFrame=CFrame.new(position you want here!)
end
end
script.Parent.Touched:connect(tele)
Report Abuse
blueboy112 is not online. blueboy112
Joined: 15 Apr 2009
Total Posts: 802
06 Jan 2013 10:13 AM
I like :MoveTo a little better.
and I'll add a debounce

time = 1 --Seconds before another player can touch it.
ting = 0
function tele(hit)
if ting == 0 and hit.Parent:FindFirstChild("Humanoid") ~= nil then
ting = 1
hit.Parent:MoveTo(Vector3.new(0, 0, 0)) --(0,0,0) is the XYZ coordinates where the player goes.
print(""..hit.Parent.Name.." was teleported!")
wait(time)
ting = 0
end
end 
script.Parent.Touched:connect(tele)


> "Even the sun sets in Paradise" ~Blueboy112
Report Abuse
VoidThrash is not online. VoidThrash
Joined: 05 Jan 2013
Total Posts: 25
06 Jan 2013 10:19 AM
Ive got

script.Parent.Touched:connect(function(hit)
if hit.Parent:findFirstChild("Humanoid") and hit.Parent:findFirstChild("Torso") then
hit.Parent:MoveTo(Vector3.new(workspace.TeleTo.Position.X,workspace.TeleTo.Position.Y+2,workspace.TeleTo.Position.Z))
end end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image