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
5 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
5 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

01local ReplicatedStorage = game:GetService("ReplicatedStorage")
02local remoteFaceTest_1 = ReplicatedStorage:WaitForChild('RemoteFaceTest1')
03 
04remoteFaceTest_1.OnServerEvent:Connect(function(player, facechange)
05    local humanoid = player.Character and player.Character:FindFirstChild("Humanoid")
06    if humanoid then
07        local descriptionClone = humanoid:GetAppliedDescription()
08        descriptionClone.Face = facechange
09        humanoid:ApplyDescription(descriptionClone)
10    end
11end)

LocalScript

1local ReplicatedStorage = game:GetService("ReplicatedStorage")
2local remoteFaceTest1 = ReplicatedStorage:WaitForChild('RemoteFaceTest1')
3 
4script.Parent.MouseButton1Click:Connect(function()
5    remoteFaceTest1:FireServer(12145366)
6end)

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 — 5y
Ad

Answer this question