Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to set a tools parent with a normal script?

I've been at it hours trying to fix"ITEM is not a valid member of Backpack",but when i look the item is still in the backpack in current server and client. I don't know anymore, help?

1 answer

✓ Accepted answer

Even though my answer is considered a comment, I'lll try to explain why.

The reason why is that the object hasn't loaded into the backpack yet. Try using :WaitForChild()

WaitForChild()

For example, we can do a LocalScript inside StarterPlayerScripts.

local Player = game:GetService("Players").LocalPlayer

local Tool = Player.Backpack:WaitForChild("Tool")

--Random code here and stuff lol

This is a hypothetical situation in which we want to find the Tool inside the Player's backpack.

I usually get a lot of errors in my games for not finding a specified object in a specific place but using WaitForChild() can help.

Click here for the developer wiki page. Good luck on your game!

1 comment

0

OMG THANK YOU IT FINALLY WORKED AFTER @% hours of trying i have just to use wait for child! TANK YOU!

This discussion is preserved as it was. New answers, comments, and votes are closed.