|
| 01 Jun 2016 04:15 AM |
I feel like a complete noob.
elseif command == 'Kill' then return game.Players.LocalPlayer.leaderstats.Fame
Output says something that attempt to index field 'LocalPlayer' (a nil value).
I need it to return the leaderstats.Fame.Value |
|
|
| Report Abuse |
|
|
2eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 1351 |
|
|
| 01 Jun 2016 04:19 AM |
Is this running from a local script?
|
|
|
| Report Abuse |
|
|
| |
|
2eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 1351 |
|
|
| 01 Jun 2016 04:28 AM |
Post the whole script and the actual error message.
|
|
|
| Report Abuse |
|
|
|
| 01 Jun 2016 04:29 AM |
Server script inside ServerScriptService that takes remote functions and does something in return. -------------------------------------------------------------------
function game.ReplicatedStorage.Command.OnServerInvoke(p, player, command) if command == 'Kill' then return game.Players.LocalPlayer.leaderstats.Fame.Value end; end;
-------------------------------------------------------------------
Parts of local script that could be a cause:
-------------------------------------------------------------------
player = script.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent fame = remote:InvokeServer(player, 'Kill') LevelofUnlock = 0
if fame.Value >= LevelofUnlock and not CheckPack:FindFirstChild("Carbine") then
________________________________________________________________________________
|
|
|
| Report Abuse |
|
|
2eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 1351 |
|
|
| 01 Jun 2016 04:30 AM |
...Ok, so it was actually NOT running from a local script.
function game.ReplicatedStorage.Command.OnServerInvoke(p, player, command) if command == 'Kill' then return player.leaderstats.Fame.Value end end
|
|
|
| Report Abuse |
|
|
|
| 01 Jun 2016 04:30 AM |
Client error ----------------------------------------------------- 12:29:04.296 - ServerScriptService.Script:8: attempt to index field 'LocalPlayer' (a nil value) 12:29:04.298 - Script 'Players.Player1.PlayerGui.EquipmentGui1.Main.OpenButton.PrimaryWeapons.AssualtRifles.AssualtRifles.ACR 6.8.Unlock', Line 4 12:29:04.298 - Stack End
-----------------------------------------------------
Server error ----------------------------------------------------- 12:29:04.212 - ServerScriptService.Script:8: attempt to index field 'LocalPlayer' (a nil value) 12:29:04.212 - Stack Begin 12:29:04.213 - Script 'ServerScriptService.Script', Line 8 12:29:04.213 - Stack End |
|
|
| Report Abuse |
|
|
2eggnog
|
  |
| Joined: 08 Nov 2008 |
| Total Posts: 1351 |
|
|
| 01 Jun 2016 04:31 AM |
or actually p.leaderstats.Fame.Value
|
|
|
| Report Abuse |
|
|
|
| 01 Jun 2016 04:34 AM |
Great! You've fixed one issue. Now there is another: --------------------------------------------------------
if fame.Value >= LevelofUnlock and not CheckPack:FindFirstChild("Carbine") then
-------------------------------------------------------- 12:32:57.050 - Players.Player1.PlayerGui.EquipmentGui1.Main.OpenButton.PrimaryWeapons.AssualtRifles.AssualtRifles.ACR 6.8.Unlock:9: attempt to index global 'fame' (a number value) 12:32:57.051 - Stack Begin 12:32:57.052 - Script 'Players.Player1.PlayerGui.EquipmentGui1.Main.OpenButton.PrimaryWeapons.AssualtRifles.AssualtRifles.ACR 6.8.Unlock', Line 9 12:32:57.052 - Stack End
|
|
|
| Report Abuse |
|
|
|
| 01 Jun 2016 04:35 AM |
Aaaahh I'm stupid, stupid. I forgot to remove .Value I've made it accidentaly check Value.Value |
|
|
| Report Abuse |
|
|
|
| 01 Jun 2016 04:36 AM |
| Thank you kind sir. You've saved another life today! |
|
|
| Report Abuse |
|
|