|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 26 May 2009 |
| Total Posts: 16893 |
|
|
| 06 Sep 2014 06:45 PM |
Conor*
And I corrected my error. |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|