Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

can someone help me with this tool for Rogue?

Asked by 9 years ago

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

Log in to vote
0
Answered by
Codebot 85
9 years ago

on line 9 its

            children = hit.Parent:GetChildren()
0
ok thank you FinickOdre123 6 — 9y
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 FinickOdre123 6 — 9y
Ad

Answer this question