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

can someone help me with this tool for Rogue?

okay, so i have been working on a touch tool and it works ... but not fully when i get someones tool, it takes it away from the other player even though it should just clone it into my backpack and leave it in the the other players as well maybe one of you can find my mistake

bin=script.Parent

function onButton1Down(mouse)
	mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
	local hit = mouse.Target
	if (hit ~= nil) then
		humanoid = hit.Parent:findFirstChild("Humanoid")
		if (humanoid ~= nil) then
			children = hit.Parent:children()
			for i=1,#children do
				if (children[i].className == "Tool", "HopperBin") then
					children[i].Parent = bin.Parent.Parent.Backpack
				end
			end
		end
	end
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
end


function onSelected(mouse)
	print("Action Tool Selected")
	mouse.Icon = "rbxasset://textures\\GunCursor.png"
	mouse.Button1Down:connect(function() onButton1Down(mouse) end)
end

bin.Selected:connect(onSelected)

1 answer

on line 9 its

            children = hit.Parent:GetChildren()

2 comments

0

ok thank you

0

well i did it but the other person still lost thier tool D: i dont want that ... is there a way so the other person keeps it? and i still get it

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