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

Problems with the "Tool Equipped" Function?

I want to make it so when you equip a tool and click anywhere, it clones where the mouse is clicked at.

local p = Game.Players.LocalPlayer
local m = Tool.Equipped:connect(function(mouse)
local model = Game.ReplicatedStorage['NameHere'];

m.Button1Down:connect(function()
    if m.Target then
        local x = model:Clone()
        if x:IsA("Model") then
            x.Parent = Workspace
            x:MoveTo(m.Hit.p)
        elseif x:IsA("BasePart") then
            x.Parent = Workspace
            x.Position = m.Hit.p
        end
end)


1 answer

Scorpian, 1st of all, Give credit who gave that to you,

By the way you should make a new line and add this (Click Enter on line one to add a space above it, and use this to make it work)

local Tool = script.Parent

1 comment

0

Yes but it still doesn't work.

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