Skip to content
This repository has been archived by the owner on Nov 10, 2018. It is now read-only.

ROBLOX's scripts output "attempt to call a nil value" #212

Closed
Quenty opened this issue Feb 7, 2014 · 11 comments
Closed

ROBLOX's scripts output "attempt to call a nil value" #212

Quenty opened this issue Feb 7, 2014 · 11 comments
Labels

Comments

@Quenty
Copy link

Quenty commented Feb 7, 2014

One of ROBLOX's core scripts will output "attempt to call a nil value" in solo test mode If certain conditions are met.

It appears when you load a character, and you have set the Players.ChracterAutoloads to false, then you will break some unknown script.

Repro

  1. Make a new place in studio
  2. Set Players.CharacterAutoLoads to false
  3. Test in SoloTestMode or the new Character Play Mode
  4. Run this code whenever you want, in that test mode.

game.Players.Player1:LoadCharacter()

image

Tadah. Error.

@SNCPlay42
Copy link

ScriptContext.Error suggests the CoreScript at fault is CoreScripts/BackpackScripts/LoadoutScript.

> game:GetService("ScriptContext").Error:connect(print)
> game.Players.Player1:LoadCharacter()
23:14:57.575 - attempt to call a nil value
attempt to call a nil value  CoreScripts/BackpackScripts/LoadoutScript

@Quenty
Copy link
Author

Quenty commented Feb 7, 2014

Yeah, I got that when I started printing out the script name instead of calling :GetFullName() which just broke everything.

@SNCPlay42
Copy link

However I can't find anything that I would expect to cause a stacktrace-less "attempt to call a nil value" errors (event connections/Spawn/delay with a value that is nil).

@matthewdean
Copy link
Contributor

The Intellisense documentation for Player:LoadCharacter says that

This function only works from a server-side (NOT a LocalScript)

@SNCPlay42
Copy link

I think you've misunderstood my code snippet, which isn't part of the Script that's erroring, but entered into the command bar to make the code at fault run, by creating a character, with a connection to ScriptContext.Error already in place.

The error can be reproduced by following the original reproduction steps, without anything entered into the command bar. That code snippet is unrelated to the bug and was just using ScriptContext.Error to determine what script was throwing that error.

@matthewdean
Copy link
Contributor

No, I am saying that Solo Mode is NOT considered a game server, and so if you don't want this error, you should use Start Server -> StartPlayer.

@SNCPlay42
Copy link

Except it still happens on servers.

server

@SNCPlay42
Copy link

Your original comment suggests you think the issue is something to do with using Player:LoadCharacter wrong, but I don't understand why you think that..

@matthewdean
Copy link
Contributor

I incorrectly assumed that Quenty had tested this on the server. Disregard my previous comment.

Do we have any ways of determining the exact cause of this bug?

@Quenty
Copy link
Author

Quenty commented Feb 21, 2014

I believe it's the backpack "Loadout" script. Line 927 seems like it could be the cause (Because it's not a generic function being connected), but I have no idea.

To be honest, if anything should be rewritten, that backpack one should be, not that this is justification for thus.

In any event, it can be reproed, so... we'll see what happens.

@Anaminus
Copy link
Owner

Issue submitted to ROBLOX/Core-Scripts

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants