Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My face changer gui isnt working?

Asked by
pr3cure -26
4 years ago

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

Log in to vote
1
Answered by
Ziruken 139
4 years ago

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

0
Thank you it works pr3cure -26 — 4y
Ad

Answer this question