Hello Developers! im trying to make a eraser where if its in eraser mode. It will erase the frame that the mouse enter. It worked but… It only works on client instead of everyone on the server.
Heres the script i created:
Server Script
local InviteId = script.Parent.Name
for _, user in pairs(game.Players:GetChildren()) do
local UserGui = user.PlayerGui
local PIXEL = UserGui:WaitForChild("GameGui", 60):FindFirstChild(InviteId).DrawingBoard:FindFirstChild(RemovePixelName)
PIXEL:Destroy()
end
end
game.ReplicatedStorage:FindFirstChild(script.Parent.Name).EraseEvent.OnServerEvent:Connect(RemovingPrints)
Client Script
local function EnteredPixel()
if script.Parent.Parent.Parent.LocalScript.ToolUsing.Value == "Eraser" then
local RemovePixelName = script.Parent.Name
game.ReplicatedStorage:FindFirstChild(script.Parent.Parent.Parent.Name).EraseEvent:FireServer(RemovePixelName)
end
end
script.Parent.MouseEnter:Connect(EnteredPixel)
Note: I used events to fire server on which frame to remove in the server from client. Player 1 is working, Player 2 doesn’t work