I have a script that whenever you click will check the item name and send a Remote Event to destroy the block, the event goes through and upon clicking will destroy, but instead of destroying the target it destroys my player's Workspace model.
Local Script located in StarterPlayerScripts:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local target = nil
mouse.Button1Down:Connect(function()
if mouse.Target.Name == "Item" or "Item2" then
target = mouse.Target
game.ReplicatedStorage.BlockDestroy:FireServer(target)
end
end)
(Theres a Remote event in ReplicatedStorage called "BlockDestroy".)
Script in Workspace to handle the Remote Event:
game.ReplicatedStorage.BlockDestroy.OnServerEvent:Connect(function(target)
target:Destroy()
end)
