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

I need help finding the error with my hair gui script, i double checked help?

ive been trying to find a fix for my hair gui but it wont work, so basically theres a image button with the picture of the hair so when you click it the picture it shows up on your head, heres my script :~~~~~~~~~~~~~~~~~ function onButtonClicked() game.Players.LocalPlayer.leaderstat.Hat.Value = 10 if game.Players.LocalPlayer.leaderstat.Hat.Value == 10 then hair = game.ReplicatedStorage.CBeauty:Clone() hair.Name = "Hair" hair.Parent = game.Players.LocalPlayer.Character local w = Instance.new("Weld") w.Part0 = game.Players.LocalPlayer.Character.Head w.Part1 = hair w.Parent = game.Players.LocalPlayer.Character.Head w.C0 = w.C0 * CFrame.new(-0,-0.5,0.2)*CFrame.fromEulerAnglesXYZ(0, math.pi, 0) wait(0.3) elseif game.Players.LocalPlayer.leaderstat.Hat.Value ~= 10 then hair:Remove() end end

script.Parent.MouseButton1Click:connect(onButtonClicked)


I dont know whats wrong with it, or maybe im not putting it in right... Someone help?

1 answer

✓ Accepted answer

game.Players.LocalPlayer does not exist or if it does it's in the workspace , if you want to change the appearance of your character, it's in the workspace under your name (example of doing something to my humanoid :

game.Workspace.Jack_Hase.Humanoid:Destroy()

) I'm not a really good scripter, so I don't know how to apply it to all players, just one

4 comments

0

"or if it does it's in the workspace" - by that I meant you can't change your appearance in game.Players, only in game.Workspace (or I just don't know much)

0

well here's a fact that might be useful, if you put the script in game.StarterPlayer.StarterCharacterScripts, the script will automatically parent to your name in the workspace (it will parent to me like game.Workspace.Jack_Hase )

0

When I look back 18 days ago... I see what you are trying to do, you can find the humanoid in game.Workspace.Jack_Hase.Humanoid or game.Players.LocalPlayer.Character.Humanoid

0

Another month later I fully understand your question. This shouldn't be the answer

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