I'm currently converting my game to use filteringenabled and I ran into a slight problem here. Basically what i'm trying to do is when a player clicks a gui, it will remove the players car from workspace and the cars gui's; which is just some controls for the car; from the player, but the script can't access PlayerGui to remove the car's gui!
here are the scripts:
I have a local script in the gui
script.Parent.MouseButton1Down:connect(function()
game.Workspace.Events.RemoveCar.Clicked:FireServer()
end)
and a normal script in a folder which is in workspace with a remoteevent called "clicked" in it
script.Clicked.OnServerEvent(function(player)
local found = false
for _, obj in pairs(game.Workspace.Vehicles:GetChildren()) do
if obj:FindFirstChild("user") then
if obj.user.Value == player.Name then
found = true
obj:remove()
end
end
end
local gui = player.PlayerGui:FindFirstChild("Display")
if gui then
gui:remove()
end
if found == false then
player.PlayerGui.carRemove.TextButton.Text = "You have none!"
wait(2)
player.PlayerGui.carRemove.TextButton.Text = "Remove Car"
end
end)
the problem is, the script can't access the players PlayerGui and I cannot find a way around this!

2 comments
FireClient
if I use fireclient it's going to say in output that it can only be called from server