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
 

Help with teleport script

Previous Thread :: Next Thread 
itachi0111 is not online. itachi0111
Joined: 05 Sep 2008
Total Posts: 1814
06 Sep 2014 06:24 PM
I'm trying to make it teleport someone to a new area after 10 seconds and then destroy the brick. The brick they touch is TeleportScene1. What am I doing wrong?

I don't really know the roblox library with the scripts so I'm guessing it has to do something with the function part of it.


function onTouched(TeleportScene1)
wait(10)
game.Workspace.Player.Torso.CFrame = CFrame.new(Vector3.new(0, 50, 0))
Workspace.TeleportScene1:Destroy()
end
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
06 Sep 2014 06:41 PM
There's a lot wrong with the script, so I'll just rewrite it.

game.Workspace.TeleportScene1.Touched:connect(function(p)
h = p.Parent:findFirstChild("Humanoid"0
if h ~= nil then
wait(10)
p.Parent.Torso.CFrame = CFrame.new(0, 50, 0)
game.Workspace.TeleportScene1:Destroy()
end
end)
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
06 Sep 2014 06:42 PM
Change the line to

h = p.Parent:findFirstChild("Humanoid")
Report Abuse
frommage is not online. frommage
Joined: 22 Apr 2014
Total Posts: 100
06 Sep 2014 06:43 PM
Function connect:OnTouch(TeleportScene1) -- I'm assuming that TeleportScene1 is an actual part ?
Report Abuse
frommage is not online. frommage
Joined: 22 Apr 2014
Total Posts: 100
06 Sep 2014 06:45 PM
And Connor had a typo make sure it is ) instead of 0 after "Humanoid"
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
06 Sep 2014 06:45 PM
Conor*

And I corrected my error.
Report Abuse
itachi0111 is not online. itachi0111
Joined: 05 Sep 2008
Total Posts: 1814
06 Sep 2014 06:54 PM
Thank you so much. I didn't realize that you couldn't just to Player, since it was a 1 player game.
Report Abuse
comiconor is not online. comiconor
Joined: 26 May 2009
Total Posts: 16893
06 Sep 2014 06:55 PM
You've got to learn how everything works, then apply logic to it.
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