Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

My face changer gui isnt working?

So i put in a code but all it does is takes away the players face

I have a ServerScript in work space : local ReplicatedStorage = game:GetService("ReplicatedStorage") game.ReplicatedStorage.RemoteFaceTest1.OnServerEvent:Connect(function(player, facechange) player.Character.Head.face.Texture = facechange end)

And here is my script for the button : local ReplicatedStorage = game:GetService("ReplicatedStorage") script.Parent.MouseButton1Click:Connect(function() game.ReplicatedStorage.RemoteFaceTest1:FireServer("rbxassetid://12145366") end)

I also have a remote event in replicated storage. I dont see any errors in the code can anyone help?

1 answer

✓ Accepted answer

Hello!

So, the method you are using to change the player's face won't work. I re-wrote your script using HumanoidDescription and it works completely fine.

Here is the code:

ServerScript

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteFaceTest_1 = ReplicatedStorage:WaitForChild('RemoteFaceTest1')

remoteFaceTest_1.OnServerEvent:Connect(function(player, facechange) 
	local humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
	if humanoid then
		local descriptionClone = humanoid:GetAppliedDescription()
		descriptionClone.Face = facechange
		humanoid:ApplyDescription(descriptionClone)
	end
end)

LocalScript

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteFaceTest1 = ReplicatedStorage:WaitForChild('RemoteFaceTest1')

script.Parent.MouseButton1Click:Connect(function() 
	remoteFaceTest1:FireServer(12145366) 
end)

I hope it works for you! If you need any questions, feel free to reply to this answer.

Sincerely, Ziruken

1 comment

0

Thank you it works

This discussion is preserved as it was. New answers, comments, and votes are closed.