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 |
|
|
|
| 05 Sep 2014 05:19 PM |
| you dont define ReplicatedStorage |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 05 Sep 2014 05:23 PM |
| it really doesnt matter which one |
|
|
| Report Abuse |
|
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
|
| 05 Sep 2014 05:25 PM |
"Players.Player.StarterGear"
you also dont define Players or Player |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 05:26 PM |
You must put game beside it
game.players game.StarterGui game.StarterGear
Ect besides workspace |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
|
| 05 Sep 2014 07:06 PM |
"Players.Player"
You can't do that. |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 07:07 PM |
Player = -- define player
game.Players.Player.Backpack |
|
|
| Report Abuse |
|
|
|
| 05 Sep 2014 07:18 PM |
| game.Players.child.StarterGear does this works? |
|
|
| Report Abuse |
|
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|
Cheeso135
|
  |
| Joined: 13 Apr 2013 |
| Total Posts: 2016 |
|
| |
|