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

Tool broken when cloning into Player's backpack?

Asked by 4 years ago

If I clone a tool into the player’s backpack nothing inside of it will run I don’t get any errors either, and everything works but not the tool. what happens

everything works but the localscript in the tool does not run.

givetoolevent.OnServerEvent:Connect(function(player, v)
    v:Clone().Parent = player.Backpack
end)

mouse.Button1Down:Connect(function()
if mouse.Target ~= nil and mouse.Target.Parent.Name == "Items" then
    local distance = (player.Character.HumanoidRootPart.Position - mouse.Target.Position).magnitude
    if distance <= 5 then
        for _,v in pairs(guns) do
            if v.Name == mouse.Target.Name then
                givetoolevent:FireServer(v)
            end
        end
    end
end
end)
0
Is the local script in this? Lava_Scripter 109 — 4y
0
the buttondown event is in the local script the onserverevent is in serverscript, if I put the gun into startergear and reset it works but not when putting it into backpack which is what i need. ComradeREKTangle 39 — 4y

Answer this question