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

How do i stop my tool from being dropped cloning it?

Asked by 5 years ago
Edited 5 years ago

Here is my script: i have searched for a while but none of them was about this issue so i couldn't figure it out

Folder = game.ReplicatedStorage.Tools
Blocks = game.ReplicatedStorage.Blocks

local children = Blocks:GetChildren()
for i = 1, #children do
    a = script.Template:Clone()
    a.Name = (children[i].Name)
    a.Click.Disabled = false
    b = children[i]:Clone()
    b.Name = "Handle"
    b.Size = Vector3.new (1,1,1)
    b.Parent = a
    b.CanCollide = false
    b.Anchored = false
    a.Parent = Folder
end

EDIT: i think it might be this equipt script that breaks it

    if key == "1" then
        if Folder.L1.Value ~= "" then
            DelTool(player.Character)
            local a = player.Backpack[Folder.L1.Value]:clone()
            Folder.Current.Value = 1
            a.Parent = player.Character
        end
0
Can you be more specific in your question? :o Pojoto 329 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

If you're holding the tool and you clone it, it's automatically parented to the player which is the location when a tool is equipped. This drops the tool onto the ground since it is not currently the selected item by the player. When you clone, you can set the parent on the same line. :Clone().Parent = PARENT.

Bottom Line:

Parent your Cloned Tool

0
a.Parent = player.Character? ForgotenR4 68 — 5y
0
The tool is already in that location. Contact me on Discord and I can help you further. Discord: Bark#4260 chexburger 358 — 5y
Ad

Answer this question