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

How do you make click detectors work inside of a equipped tool?

Asked by
ahlxs -8
5 years ago
Edited by User#24403 5 years ago

Is there a way to do this?

local Tool = script.Parent 

Tool.Equipped:Connect(function(Mouse) 
    Mouse.Button1Down:Connect(function() 
        if mouse.Target and mouse.Target.Parent then 
            Parent:remove() 
        end
    end)
end)
0
Just use the mouse.Target property in the meantime User#24403 69 — 5y
0
What am I doing wrong? local Tool = script.Parent Tool.Equipped:Connect(function(Mouse) Mouse.Button1Down:Connect(function() if mouse.Target and mouse.Target.Parent then Parent:remove() end ahlxs -8 — 5y
0
Why not add this script ^ to your question to make clearer please starmaq 1290 — 5y
0
and why r u just saying Parent? thats wrong starmaq 1290 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

When answering, if your answer does not fully solve the question, it should be written as a comment to the question instead of as an answer.

Use Activated for tools, this is fired whenever the mouse is pressed

script.Parent.Activated:Connect(function()
    -- do stuff
end)

More information on functions about Tool

0
no User#24403 69 — 5y
0
that wasn't rlly his question starmaq 1290 — 5y
Ad

Answer this question