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
Well, you can't fire a RemoteEvent with a server using FireClient Change the serverscript in your GUI to a LocalScript and put this code.
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 if not face:IsA("LocalScript") then face.MouseButton1Down:connect(function(player) local realface = face.Image game.ReplicatedStorage:WaitForChild('Faces'):FireServer(realface)--Firing it correctly end) end end end