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

How do i make a script so it will wait then give a gear?

This is what i have tried.

wait(5)
Workspace.Players:GiveItem "http://web.roblox.com/Turbos-Speed-Shell-item?id=163323379"

Output doesn't show errror.Help!

1 answer

Hmm, try this;

wait(0) --Sometimes have to do this, because sometimes it doesn't work otherwise :l
repeat wait(0)until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
IDOFASSET = 161211213 --Switch out 0's with the Id of a Gear/Hat/Model/ect.
wait(5) --Waits 5 seconds
if game:FindService("InsertService") then --If script finds the service InsertService within game then
asset = game:GetService("InsertService"):LoadAsset(IDOFASSET) --Loads the asset (Gear/Hat/Model/ect.) that has the Id (For example, the Id for my KAC's is 161160031, and if I switch out the 0's with the Id, then KAC's will load into the game, no "http://www.roblox.com/" required)
for i, v in pairs(asset:GetChildren())do --For loop needed, gets all children within the Model
if v:IsA("Hat") or v:IsA("Tool")then --If the children's className equal to a Hat or Gear then
v.Parent = game.Players.LocalPlayer.Character --Sets the parent of the Hat/Gear to a different parent, switch out 'PARENTHERE' with where you want the children's parent to be set to
end --The end for the 'if' statement
end --The end for the for loop
end --The end for the 'if' statement

Did the script for a LocalScript, and it worked, but if it still doesn't then I'm confused. ;-; Hope this helped! (Sorry if did any errors, was 12 o'clock when posted answer ;-;)

2 comments

0

Hmm.Not working.If you could try again with another script thanks!

0

There, I edited it a bit, works for a LocalScript, but you can edit if you want to man. Hope this helped! ;)

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