plistra
|
  |
| Joined: 12 Mar 2014 |
| Total Posts: 859 |
|
|
| 07 Jul 2014 02:54 AM |
This is what I have:
~~ local TeleIn = script.Parent local TeleOut = script.Parent.Parent:FindFirstChild("TeleOut")
TeleIn.Anchored = true
TeleIn.Touched:connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then local torso = hum.Parent:FindFirstChild("Torso") wait(2) torso.Position = Vector3.new(TeleOut.Position) end end) ~~
It kills me because it only moves the Torso. Why does it only move the Torso? I thought I read somewhere that if you move the torso, the whole player moves with, is that not true? |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2014 03:04 AM |
It's killing you because instead of moving all of the limbs, it's separating the "Torso" from the others, try using this, local TeleIn = script.Parent local TeleOut = script.Parent.Parent:FindFirstChild("TeleOut")
TeleIn.Anchored = true
TeleIn.Touched:connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid") if hum then wait(2) hit.Parent:MoveTo(Vector3.new(TeleOut.Position)) end end) More information on the :MoveTo() method can be found here, http://wiki.roblox.com/index.php?title=MoveTo_%28Method%29 |
|
|
| Report Abuse |
|
|
plistra
|
  |
| Joined: 12 Mar 2014 |
| Total Posts: 859 |
|
|
| 07 Jul 2014 03:07 AM |
| Hmm. It just moves me to the spawn. I guess I'll have to put TeleOut's Vector3 coordinates instead if it's general position. |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2014 03:08 AM |
Contrary to my reply, you can actually just use, hit.Parent:MoveTo(TeleOut.Position) when you're using :MoveTo(). |
|
|
| Report Abuse |
|
|
plistra
|
  |
| Joined: 12 Mar 2014 |
| Total Posts: 859 |
|
|
| 07 Jul 2014 03:08 AM |
| I added the coordinates and it works now. Thanks for your help! |
|
|
| Report Abuse |
|
|
plistra
|
  |
| Joined: 12 Mar 2014 |
| Total Posts: 859 |
|
|
| 07 Jul 2014 03:09 AM |
That works! Thanks. PS, how long did it take you to learn that much Lua? |
|
|
| Report Abuse |
|
|
|
| 07 Jul 2014 03:11 AM |
| Quite awhile, I still have plenty more to learn though, it's entertaining when you do learn about a new concept and are able to grasp it. |
|
|
| Report Abuse |
|
|
plistra
|
  |
| Joined: 12 Mar 2014 |
| Total Posts: 859 |
|
|
| 07 Jul 2014 03:11 AM |
| I know. That's why I like Lua. It's simple and easy to learn, yet rewarding when you accomplish stuff. |
|
|
| Report Abuse |
|
|