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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Code not working????? HELP

Previous Thread :: Next Thread 
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:18 PM
So. Basically I have a code that should give a player a tool called fur in replicated storage. I get this error in output:

Workspace. .Exp/GoldScript:9: attempt to index global 'ReplicatedStorage' (a nil value)

local Humanoid = script.Parent.Humanoid

function DropScript()
local tag = Humanoid:findFirstChild("creator")
if tag ~= nil then
if tag.Value ~= nil then
local drop = tag.Value:findFirstChild("StarterGear")
if drop ~= nil then
ReplicatedStorage.Fur:Clone().Parent=Players.Player.StarterGear
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(DropScript)
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 05:19 PM
you dont define ReplicatedStorage
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:22 PM
oh. so i should just change to game.replicatedstorageblahblahblah or do I have to go local ReplicatedStorage = game.Replicated........?
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 05:23 PM
it really doesnt matter which one
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:24 PM
Its not working :/
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
05 Sep 2014 05:25 PM
"Players.Player.StarterGear"

you also dont define Players or Player
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
05 Sep 2014 05:26 PM
You must put game beside it

game.players
game.StarterGui
game.StarterGear

Ect besides workspace
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:26 PM
Nvm. It is this error now:

Workspace. .Exp/GoldScript:9: attempt to index global 'Players' (a nil value)

How do I define after the = sign in line 9?
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:33 PM
bump
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 05:42 PM
bump
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:12 PM
bubump
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:16 PM
bumpetyubuy
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:21 PM
bump
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:30 PM
bump
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:38 PM
bump
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:48 PM
bubububububmp
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 06:53 PM
bump
Report Abuse
xXNamenotfoundXx is not online. xXNamenotfoundXx
Joined: 26 Aug 2012
Total Posts: 82
05 Sep 2014 07:06 PM
"Players.Player"

You can't do that.
Report Abuse
xXNamenotfoundXx is not online. xXNamenotfoundXx
Joined: 26 Aug 2012
Total Posts: 82
05 Sep 2014 07:07 PM
Player = -- define player

game.Players.Player.Backpack
Report Abuse
Touchforce is not online. Touchforce
Joined: 22 Jul 2012
Total Posts: 3565
05 Sep 2014 07:18 PM
game.Players.child.StarterGear does this works?
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 07:54 PM
I change this:

game.ReplicatedStorage.Fur:Clone().Parent=Players.Player.StarterGear

to this

game.ReplicatedStorage.Fur:Clone().Parent= game.Players.Player.StarterGear

and it does not work.
Report Abuse
lordrambo is not online. lordrambo
Joined: 16 Jun 2009
Total Posts: 20628
05 Sep 2014 08:01 PM
"local drop = tag.Value:findFirstChild("StarterGear") "

so after reading your code I would think tag is a bool or string object, and they have the property "Value", and you are trying to call FindFirstChild on a property, right?

It's possible this is not the case, but if it is like I suppose it is, that will not work.

This line will need to be changed:
ReplicatedStorage.Fur:Clone().Parent=Players.Player.StarterGear --game.Players not just Players


Not really sure how your game looks hierarchically, so I can't really determine how you could locate Player besides going into game.Players and pulling out the one you want, but I'm sure you can.
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 08:07 PM
Well, to be honest, I took the classic Experience and gold script and thought that I could edit it for my own purposes. Apparently not. How would I create a script that would do what I am trying to get this to do? Or, alternatively, (if this is easier) I would like to create a script that (when this thing is killed) Have a guy pop up....I am willing to work through it but I will need some major help with it. (I am terrible at things having to do with targets :/
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 08:24 PM
bumpbety
Report Abuse
Cheeso135 is not online. Cheeso135
Joined: 13 Apr 2013
Total Posts: 2016
05 Sep 2014 08:35 PM
bubompbuy
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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