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: Help simple random item giver!

Previous Thread :: Next Thread 
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
19 Dec 2014 12:58 PM
line 8 (I think that's what the dev console said) it said : attempt to index a global value "b" nil?

I did define it?

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
Colours = game.ServerStorage:GetChildren()
i = math.random(1,#Colours)
RandomCol = Colours[i]
a = RandomCol:clone()
b = game.Players:GetPlayerFromCharacter(character.Parent)
a.Parent = b.StarterPack
end)
end)
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
19 Dec 2014 01:08 PM
"b = game.Players:GetPlayerFromCharacter(character.Parent)"
"GetPlayerFromCharacter"
"PlayerFromCharacter"
"FromCharacter"
"Character"
"character.Parent"
uwot
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
19 Dec 2014 01:11 PM
wat
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
19 Dec 2014 01:14 PM
maybe add something like this...

character = player.Character
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
19 Dec 2014 01:16 PM
player.CharacterAdded:connect(function(character) < defined here when event fires function.
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
19 Dec 2014 01:20 PM
Bump?
Report Abuse
lampwnage121 is not online. lampwnage121
Joined: 20 Oct 2012
Total Posts: 4285
19 Dec 2014 01:24 PM
.-.
Did you not read what I said
I was emphasizing "FromCharacter" and the fact that character.Parent ~= character thus it'll return nil.
Report Abuse
rockandgreen is not online. rockandgreen
Joined: 20 Dec 2011
Total Posts: 1161
20 Dec 2014 11:30 AM
o I get it. Thanks.
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