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

How to make a special weapon come in the backpack of special people (Not as Starterpack)?

Well I tried this but it won't work. Well I have Leaders in my game and I made them special tools but I don't know how to let it go in their backpack. I want to come it in my backpack, but here it won't work.

adminlist = {"Nilbarua"} tools = {"Particle Release"} 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 answer

adminlist = {"Nilbarua"}
tools = {} --here
for a,b in ipairs(game.Lighting.EmperorTools:GetChildren()) do
	if b.ClassName == "Tool" or b.ClassName == "HopperBin" then --here
		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() = guy.Backpack
				end 
			end 
		end) 
	end 
end)

--Removed "Particle Release" from the table and changed 'className' to 'ClassName'. I tested it in Studio, worked for me. I think it was because when it came to putting the clone in the backpack, it went through "Particle Release", the string value, and brought an error.

2 comments

0

But how do I let the tool come in my backpack then?

0

What do you mean?

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