im trying to make a filtering enabled face changer gui.
I have these 2 scripts, ServerScriptService and the Server Script in the gui
****the error is on line 7 in the server script in the gui
ServerScriptService:
game.ReplicatedStorage:WaitForChild('Faces').OnServerEvent:connect(function(player,realface)
print("asd")
player:WaitForChild('Character').Head.face.Texture = realface
end)
Server script in the gui:
local f = script.Parent:GetChildren()
for i = 1,#f do
local face = f[i]
if face.Name == "Face" or face.Name == "Face1" or face.Name == "Face2" then
face.MouseButton1Down:connect(function(player)
local realface = face.Image
game.ReplicatedStorage:WaitForChild('Faces'):FireClient(realface)
end)
end
end

2 comments
if your game have filtering enabled you should use a RemoteEvent
Im using a remote event.