|
| 29 Oct 2013 04:13 PM |
for i = 1,72 do I = string.sub(S.Inventory.Value,i*3-2,i*3) if I ~= "aaa" then GI = game.ServerStorage.GameItems:FindFirstChild(I) IS = GI.Stats.Value
The last line of this script (this isn't the whole thing, just the part that's breaking) has an error that comes up saying that GI is nil. The value of I is "aab" and there is a StringValue in game.ServerStorage.GameItems named aab, so why is GI nil? This part of the script is in a PlayerAdded function, and when I print(I) it comes up with "aab". Anyone see whats wrong?
|
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 04:14 PM |
>i*3-2 wouldn't that be i*1 making that useless |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 04:21 PM |
| "I" needs to equal 1 3, 4 6, 7 9, etc. |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Oct 2013 06:59 PM |
| Why would I need to divide? |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 08:22 PM |
Here's a longer version, I can't post the whole thing because it keeps getting blocked for some reason:
function Inventory() for i = 1,72 do I = string.sub(S.Inventory.Value,i*3-2,i*3) if I ~= "aaa" then ST = game.ServerStorage.Guis.ScreenTip:clone() GI = game.ServerStorage.GameItems:FindFirstChild(I) IS = GI.Stats.Value -- Error here end end end
GI should be a variable for game. ServerStorage.GameItems:FindFirstChild("aab") but no matter what I do is says GI is a nil value. I = "aab", and there is a StringValue in GameItems named aab. Inventory() gets called each time a new player joins.
|
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 08:27 PM |
">i*3-2 wouldn't that be i*1 making that useless" No. Its (i * 3) - 2, not i * (3 - 2).
"GI should be a variable for game. ServerStorage.GameItems:FindFirstChild("aab") but no matter what I do is says GI is a nil value. I = "aab", and there is a StringValue in GameItems named aab. Inventory() gets called each time a new player joins."
This sounds like its being executed in a local script, cause if it is then obv ServerStorage can't be touched on a client.
"Here's a longer version, I can't post the whole thing because it keeps getting blocked for some reason:"
Use something like pastebin. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 08:35 PM |
"This sounds like its being executed in a local script" The script is just a normal script inside ServerScriptService. Everything in it works fine apart from the :FindFirstChild(I) coming up as nil.
I also forgot to say that I don't really need to post a longer version, this is the only part that gets an error. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 08:40 PM |
"I also forgot to say that I don't really need to post a longer version, this is the only part that gets an error."
How helpful.
Try this:
pastebin/LCfqiUwu
In theory, this should work, or its a problem on your end, I assume. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 08:45 PM |
"pastebin/LCfqiUwu" Er...what do I do with this? Nothing's coming up in the address bar. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 29 Oct 2013 08:47 PM |
copy it, add a dot com and enter.
wow -.- |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2013 08:52 PM |
Yeah...I knew that:
pastebin/t12srcjV |
|
|
| Report Abuse |
|
|
| |
|
Kaffeine
|
  |
| Joined: 27 Oct 2013 |
| Total Posts: 230 |
|
|
| 30 Oct 2013 02:56 PM |
GI = game.ServerStorage.GameItems:FindFirstChild(I) IS = nil
if (GI) then IS = GI end |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2013 03:12 PM |
| Thank you so much Kaffeine. I've been trying to fix that for 3 days, finally works now. |
|
|
| Report Abuse |
|
|