Im trying to script that destroys parts when you click it but i cant connect mouse.Target to a remove event this is the script that i have
This is the local script
local UserInputService = game:GetService("UserInputService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
UserInputService.InputBegan:Connect(function(input, mouse) if input.UserInputType == Enum.UserInputType.MouseButton1 then mouse.Target:FireServer(mouse) end end)
This is the server script
local ReplicatedStorage = game:GetService("ReplicatedStorage") local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
mouse.Target.OnServerEvent:Connect(function(player, mouse) mouse.Target:Destroy() end)

3 comments
It didnt work it says "attempt to index boolean with Target"
Oops, I made an error. I edited it and it should now work.
Thanks