I'm trying to destroy a part when I click it. What I tried to do is below:
local mouse = game.Players.LocalPlayer:GetMouse() mouse.Button1Down:Connect(function() mouse.Target:Destroy() warn("working") end)
I'm using a local script but the warn doesn't work and neither does the destroying of the part. I also used a remote event to see if that would help, it accomplished nothing. I'd appreciate any help to this problem.
using clickdetector. it works so well that it will work with a part, or a model. basically you do this, put a script file right under the object you want to destroy,
local part = script.Parent local cd = Instance.new("ClickDetector", cd) cd.MouseClick:Connect(function(player) -- do whatever you want to destroy the part. end)