Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to fix ITEM is not a valid member of Backpack?

Asked by 5 years ago
Edited 5 years ago

So i take a look again it isn't in starter gear but it's in back pack but it still says Fireball is not a valid member of back pack and here's what i do so far:

wait(0)

for i, v in pairs(game.Teams["Civilian"]:GetPlayers()) do

v.Backpack:Fireball():Destroy()

end

0
try :WaitForChild() Mr_Unlucky 1085 — 5y
0
i dont know where to put WaitForChild() NungkiceNicekung 22 — 5y
0
Can you explain with more detail exactly what you're trying to accomplish with this script? Also post the script that you have so far MegaManSam1 207 — 5y
0
ok NungkiceNicekung 22 — 5y
View all comments (3 more)
0
i think the problem is the proper usage of localscript and normal script CjayPlyz 643 — 5y
0
if you made something with local script, it wont replicate into the server. which means if you tried to find that thing you made with a localscript you will certainly not find it CjayPlyz 643 — 5y
0
Should it not be v.Backpack.Fireball:Destroy()? Instead of v.Backpack:Fireball():Destroy(). Recruitsoldier 40 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

The problem is that you have Fireball() as a function instead of just getting the instance. Instead of v.Backpack:Fireball():Destroy() do v.Backpack.Fireball:Destroy or v.Backpack:WaitForChild("Fireball"):Destroy()

0
I tried but it says Fireball is not a valid member of Backpack NungkiceNicekung 22 — 5y
0
Replace :Fireball() with .Fireball IceAndNull 142 — 5y
Ad
Log in to vote
0
Answered by
CjayPlyz 643 Moderation Voter
5 years ago

If you made an Instance with a local script, it won't replicate to the server. So if you tried to index it with a normal script it won't work. To test this, go to Test and click Play then you should find "Current: Client" just beside the Play button. So first go to the backpack if you see fireball then click the "Current: Client", it should change to "Current: Server" now go to backpack, if you don't see the fireball then its the problem. If this is the problem then try making the fireball and set its parent to the player's backpack with a normal script.

0
If i'm wrong then please edit your question and put your script that makes the fireball CjayPlyz 643 — 5y
0
Thank you, i just realized that the tool transport into my character model this is helpful :) NungkiceNicekung 22 — 5y
0
but still. It only happens if you pull the item out, so if you delete it in the backpack first there will be no item. NungkiceNicekung 22 — 5y

Answer this question