|
| 09 Jul 2016 12:43 AM |
the player is supposed to click this button in a elevator and its supposed to then teleport them but for some reason its not, here's the script
script.Parent.ClickDetector.MouseClick:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.Torso.CFrame = CFrame.new(356.6, 4.707, -62.8) end end) I have a click detector in |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2016 12:54 AM |
MouseClick doesn't work the same way as the touched event. Its parameter is the Player who clicked it, whereas the touched event's parameter is the part that hit it.
if you do player.Parent (game.Players) you're not gonna find a humanoid.
script.Parent.ClickDetector.MouseClick:connect(function(player) player.Character:WaitForChild("Torso").CFrame = CFrame.new(356.6, 4.707, -62.8) end)
|
|
|
| Report Abuse |
|
|
pidgey
|
  |
| Joined: 16 Jan 2008 |
| Total Posts: 2739 |
|
|
| 09 Jul 2016 12:59 AM |
cframing a part in the character to teleport someone is futile, there's a function called MoveTo, although it's required to use vector3 as far as im concerned
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|