Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. Add Folder name it Event and in it create remote event in ReplicatedStorage name it HairEvent1
- 2. Create Folder in ReplicatedStorage name it Hair and put your Hair inside and name it Hair1 -- First Hair
- Hair2 -- Second Hair etc
- AND DONT FORGET TO CHANGE EVENTS AND HAIR NUMBER WHEN ADDING NEW HAIR!!!!
- --
- Local Script in Button which will equip the haird
- --
- script.Parent.MouseButton1Click:Connect(function()
- game.ReplicatedStorage.Events.HairEvent1:FireServer()
- end)
- -----
- Create another script in ServerScriptService put this code inside
- ----
- while true do
- wait(0.1)
- local w = game.Workspace:GetChildren()
- for i=1, #w do
- c = w[i]:GetChildren()
- for i=1, #c do
- if (c[i].className == "Accesory") then
- c[i]:remove()
- end
- end
- end
- end
- -------------------
- Put this in ServerScriptService (or in your script)
- --------------------
- game.ReplicatedStorage.Events.HairEvent1.OnServerEvent:Connect(function(plr) -- change event if u have other
- local Storage = game.ReplicatedStorage.Hair.Hair1 -- change name if u want
- local char = plr.Character
- if char:FindFirstChild("Humanoid") then
- local Folder = char.Head.Hair
- Folder:ClearAllChildren()
- local Head = char.Head
- local New_Hair = Storage:Clone()
- New_Hair.Parent = Folder
- New_Hair.Position = Head.Position
- local Weld = Instance.new("Weld")
- Weld.Parent = New_Hair
- Weld.Part0,Weld.Part1 = Head, New_Hair
- Weld.C0 = CFrame.new(0,0.8,0) -- change if your hair isnt on right place
- Weld.C1 = Head.HairAttachment.CFrame
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement