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

How can I let a special tool come in my backpack?

Well I tried this from free models but nothing worked. I wanted to put a tool called Particle Release in it but I don't know how precisely. Please help me.

adminlist = {"Nilbarua"} tools = {} for a,b in ipairs(game.Lighting.EmperorTools:GetChildren()) do if b.className == "Tool" or b.className == "HopperBin" then table.insert(tools,b:clone()) end end game.Players.ChildAdded:connect(function(guy) if guy.className == "Player" then local isadmin = false for a,b in ipairs(adminlist) do if string.lower(b) == string.lower(guy.Name) then isadmin = true end end if isadmin == false then return end guy.Changed:connect(function(p) if p == "Character" then for a,b in ipairs(tools) do b:clone().Parent = guy.Backpack end end end) end end)

1 comment

1

Wrap your code in the code block syntax to make it readable.

1 answer

adminlist = {"Nilbarua"}

game.Players.PlayerAdded:connect(function(np)
for _,v in pairs(adminlist) do
if v:lower() == np.Name:lower() then --if the name of the 'admin' is the same as the player
for ind,tool in pairs(game.Lighting.EmperorTools:GetChildren()) do --loop through the model of tools
tool:Clone().Parent = np.StarterGear --StarterGear gets cloned into the Backpack each time you spawn
end
break --exit the loop of the list of admin if there's a match, after you do the cloning
end
end
end)

2 comments

0

I have something called Particle Release in it, so how can that be spawned in my backpack?

0

Oh, I see. I didn't read that you used free models, for this. You can either make a model in Lighting called EmperorTools and then put your tool in it, or you can modify the script to remove the second generic for loop and have it clone specifically that item, parenting it to your StarterGear.

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