voItages
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 677 |
|
|
| 29 May 2015 05:21 PM |
plr = game.Players.LocalPlayer char = plr.Character
It says char is a nil value in the developer console in-game
=volty= |
|
|
| Report Abuse |
|
|
voItages
|
  |
| Joined: 02 Nov 2013 |
| Total Posts: 677 |
|
| |
|
gergy008
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 7039 |
|
|
| 29 May 2015 05:32 PM |
plr = game.Players.LocalPlayer char = plr:WaitForChild("Character") |
|
|
| Report Abuse |
|
|
OKevinO
|
  |
| Joined: 05 May 2010 |
| Total Posts: 1036 |
|
|
| 29 May 2015 05:33 PM |
Either because you are using a Global script, since you cant call a LocalPlayer with a global script. Or because your second line "char" is trying to define your character before your character is even created (spawned in).
Solutions: -Add a wait time before the "char" variable so it waits long enough for your character to spawn. -Create a "CharacterAdded" function to trigger the function whenever your player is spawned, and then define your variable in that function. |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 29 May 2015 05:57 PM |
local player = game.Players.LocalPlayer local char = player.Character
if char then --code end |
|
|
| Report Abuse |
|
|
|
| 29 May 2015 05:58 PM |
plr = game.Players.LocalPlayer char = plr.Character or plr.CharacterAdded:wait() |
|
|
| Report Abuse |
|
|