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

Problems with the "Tool Equipped" Function?

Asked by 10 years ago

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

Log in to vote
1
Answered by
Hybric 271 Moderation Voter
10 years ago

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
0
Yes but it still doesn't work. xXScorpianKillerXx 25 — 10y
Ad

Answer this question