Only destroy the player who fires the event

local InviteId = script.Parent.Name
	for _, user in pairs(game.Players:GetChildren()) do
		local UserGui = user:WaitForChild("PlayerGui", 60)
		local GAMEIDGUI = UserGui:WaitForChild("GameGui", 60):FindFirstChild(InviteId)
		local PIXEL = GAMEIDGUI.DrawingBoard:FindFirstChild(RemovePixelName)
		if PIXEL then
			PIXEL:Destroy()
			print(user) -- Optional 
		else
			warn("Can't find Player2") -- Optional
		end
	end

it worked at first in here but it started to never work anymore…

Im trying to make a eraser in a drawing game I’m making. But when its getting deleted. The eraser only destroy the frame on the player’s UI who fired the event. Thanks for the help, i appreciate it!

If you want to delete the frame from everyone you’ll need to use FireAllClients() or loop through every player.

it didn’t work… i tried different types of fire all clients but. What happen is when firing all clients. the local script didn’t receive the message

Please show how you’re using the remote event(s)

Server

game.ReplicatedStorage:FindFirstChild(script.Parent.Name).EraseEvent.OnServerEvent:Connect(function(player,RemovePixelName)
	local InviteId = script.Parent.Name
	game.ReplicatedStorage:FindFirstChild(InviteId).EraseEvent.EraseAllClient:FireAllClients(RemovePixelName)
	print(RemovePixelName) -- Test only to know if the function is running
end)

Client

game.ReplicatedStorage:FindFirstChild(script.Parent.Name).EraseEvent.EraseAllClient.OnClientEvent:Connect(function(RemovePixelName)
	if script.Parent.DrawingBoard:FindFirstChild(RemovePixelName) then
		script.Parent.DrawingBoard:FindFirstChild(RemovePixelName):Destroy()
		print(RemovePixelName) -- Test only to know if the function is running
	end
end)