|
| 01 May 2014 09:47 PM |
local player = game.Players.LocalPlayer
function RArrow() print(player) print("Entering Teleport") player.Torso:MoveTo(player.Torso.Position + 0,0,4) wait() end script.Parent.MouseButton1Down:connect(RArrow)
I have no idea why I'm getting: MoveTo is not a valid member of player... Anybody have any ideas? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 01 May 2014 09:49 PM |
| local player = Game.Players.LocalPlayer.Character |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 01 May 2014 09:50 PM |
local player = game.Players.LocalPlayer.Character
function RArrow() print(player) print("Entering Teleport") player:MoveTo(player.Torso.Position + 0,0,4) wait() end script.Parent.MouseButton1Down:connect(RArrow) |
|
|
| Report Abuse |
|
|
|
| 01 May 2014 09:51 PM |
| Now I'm getting Torso is not a valid member of player.. |
|
|
| Report Abuse |
|
|
| |
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 01 May 2014 10:15 PM |
local player = game.Players.LocalPlayer.Character
script.Parent.MouseButton1Down:connect(function() print(player.Name.." Entering Teleport") player:MoveTo(Vector3.new(player.Torso.Position.X, player.Torso.Position.Y, player.Torso.Position.Z + 4)) end) |
|
|
| Report Abuse |
|
|
|
| 01 May 2014 10:23 PM |
| attempt to index player a nil value, Line 4 |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 01 May 2014 10:28 PM |
| How can that be if I tested it myself? |
|
|
| Report Abuse |
|
|
|
| 01 May 2014 10:29 PM |
| Local script, Inside a Image Button? |
|
|
| Report Abuse |
|
|
Cizox
|
  |
| Joined: 25 Dec 2009 |
| Total Posts: 42220 |
|
|
| 01 May 2014 10:34 PM |
| Yes, I tested this inside a LocalScript within a GUI Frame. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 01 May 2014 10:35 PM |
Its because the character doesn't exist when you try and run the script. Check if it exist before declaring your variable. |
|
|
| Report Abuse |
|
|
|
| 01 May 2014 10:36 PM |
| Well than, I have no idea! hmmm ita hm hm |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 May 2014 10:40 PM |
| Thanks a ton 128GB I got it working! |
|
|
| Report Abuse |
|
|