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

Problem cloning tools to players backpack? (FE)

Asked by 6 years ago

Upon the click of a GUI, my tool is cloned from replicated storage to the players backpack.

There is a local script in the GUI that fires the remote event for the Tool-Giver.

The code below is a script inside the workspace to give the player the tool.

The tool itself does appear in the players backpack but for some mysterious reason the handle and another part are missing.

storage = game:GetService("ReplicatedStorage")

local ToolGiverEvent = storage:WaitForChild("ToolGiverEvent")

--Guns, I've tried storing the guns in lighting and workspace.
guns = game.ReplicatedStorage.Guns


--the gun
M1 = guns.M1Garand


ToolGiverEvent.OnServerEvent:connect(function(player)

    local backpack = player.Backpack

    if player.Character ~= nil then

        --M1C is the guns clone
        local M1C = M1:Clone()

        M1C.Parent = backpack

    end


end)

Let me know if you need more information. Any help is appreciated! Thank you for reading!

0
Provide the local script? yoshi8080 445 — 6y
0
Try using MakeJoints() to keep tool together? so for example M1C:MakeJoints() birdeater11 14 — 6y
0
I tried MakeJoints it came with an error: makejoints not valid member of tool ozzeygaitanflores 15 — 6y

Answer this question