Eclipsin
|
  |
| Joined: 09 Feb 2012 |
| Total Posts: 5197 |
|
|
| 27 Dec 2013 07:49 PM |
Can anyone tell me why this isn't working?
--
function onClick(x) script.Parent.Parent.Visible = false x.Character.Torso.CFrame = CFrame.new(Vector3.new(-28.5, 1.8, 38)) end
script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
Nagrath99
|
  |
| Joined: 26 Mar 2011 |
| Total Posts: 1537 |
|
|
| 27 Dec 2013 07:54 PM |
It may be that x isn't labelled as a Player. Use game.Players.LocalPlayer.Character.Torso.CFrame (if in a LocalScript) or since the script.Parent.Parent is not visible, the script is deactivated. So you need to have it invisibilized after. |
|
|
| Report Abuse |
|
|
ozzzyt
|
  |
| Joined: 08 Jan 2013 |
| Total Posts: 3576 |
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Dec 2013 07:55 PM |
| x is not a player object returned by the MouseButton1Click event |
|
|
| Report Abuse |
|
|
Eclipsin
|
  |
| Joined: 09 Feb 2012 |
| Total Posts: 5197 |
|
|
| 27 Dec 2013 08:00 PM |
It says that x == nil
Why is that, and how can I make it so it is the player?
-{E_ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 27 Dec 2013 08:08 PM |
Is this a local script? If so:
function onClick(x)
script.Parent.Parent.Visible = false x.Character.Torso.CFrame = CFrame.new(Vector3.new(-28.5, 1.8, 38))
end
script.Parent.MouseButton1Click:connect(function() onClick(Game.Players.LocalPlayer) end)
If not, replace Game.Players.LocalPlayer to script.Parent.Parent.blahblah |
|
|
| Report Abuse |
|
|
Eclipsin
|
  |
| Joined: 09 Feb 2012 |
| Total Posts: 5197 |
|
| |
|