generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Script working in Solo but not in Test

Previous Thread :: Next Thread 
Cryptorenzo is not online. Cryptorenzo
Joined: 03 Jun 2016
Total Posts: 7
11 Jun 2017 01:27 PM
Hello, I am doing a race randomizer for my rpg. It works perfectly fine when running the studio on solo but I get the following error whenever I run a test :
----------------------------------------------------------------------------------------
14:15:49.778 - Players.Player1.Backpack.RandomRace:7: attempt to index global 'Player' (a nil value)
----------------------------------------------------------------------------------------

This is the part of my script it's reffering to (The "if" statement):
----------------------------------------------------------------------------------------
wait(2)

Player = game.Players.LocalPlayer

if not(Player.RaceChosen.Value) then
print("Randomizing Race...")
GeneratedRarity = math.random(1,100)
----------------------------------------------------------------------------------------

From what I understand, this would mean that "Player" does not exist.

I'm quite new at Lua, still learning, but I can't grasp on what I'm doing wrong here. Do you guys have any ideas?

Thanks in advance!
Crypto
Report Abuse
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
11 Jun 2017 01:28 PM
That's an LocalScript or Script?
Report Abuse
Cryptorenzo is not online. Cryptorenzo
Joined: 03 Jun 2016
Total Posts: 7
11 Jun 2017 01:30 PM
Hey, thanks for the fast reply!

It is a Script.
Report Abuse
Cryptorenzo is not online. Cryptorenzo
Joined: 03 Jun 2016
Total Posts: 7
11 Jun 2017 01:34 PM
Just changed to a LocalScript, it appears to be working!

Thanks a lot!
Report Abuse
dadibox1234 is not online. dadibox1234
Joined: 05 Dec 2013
Total Posts: 320
11 Jun 2017 01:57 PM
No Problem :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image