And this is the code for the function that destroys the object:
grom.OnClientEvent:Connect(function(v)
local mark = v.Parent:FindFirstChild("Mark")
mark:Destroy()
print("here")
end)
Both are in the same local script, and both are the result of a Client → Server → Client RemoteEvent. The “print(“here”)” part of the script works, so it’s not like there’s an error, but the “mark” will not be destroyed.
Check if there’re multiple highlights due to the remote running multiple times. That’s an error/bug on its own but here’s the solution for it:
local function destroy(v: Instance)
for _, child in pairs(v.Parent:GetChildren()) do
if child.Name == "Mark" and child:IsA("Highlight") then
child:Destroy()
end
end
end
--example
grom.OnClientEvent:Connect(function(v)
destroy(v)
print("here")
end)