hi, so basically i'm having this problem (title), and i do not understand what is wrong. i'm using a remote event (FireServer) to destroy a part (in workspace) that spawns. code:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function() local waa = game.Players.LocalPlayer:FindFirstChild("NicePartlol") wait() waa:Destroy() end)
You can use the player parameter for the event 'OnServerEvent'. Since this is a ServerScript, you cannot state the LocalPlayer.
You can replace the variable by doing this:
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player) local waa = player:FindFirstChild("NicePartlol") wait() if waa =~ nil then waa:Destroy() end end)