Hello, so recently I commissioned someone to make me a funny hair clipper script that randomizes giving you a hair example. However he did not realize the video removed the hairs that the character had before hand example. The commission came with 2 scripts. One being a server script and one being a local script
Server Script
local re = game.ReplicatedStorage.ChangeHair
local hairModels = game.ReplicatedStorage.Hair
local hair = nil
local used = false
re.OnServerEvent:Connect(function(Sentplr, plr)
if used == true then
hair:Destroy()
end
local randnum = math.random(1, 9)
hair = hairModels[randnum]:Clone()
hair.Parent = plr
hair.Weld.Part0 = hair.Hair
hair.Weld.Part1 = plr.Head
if used == false then
used = true
end
end)
Local Script
local tool = script.Parent
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local idleAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.IdleAnim)
local useAnim = char:WaitForChild("Humanoid"):LoadAnimation(script.UseAnim)
local hairModels = game.ReplicatedStorage.Hair:GetChildren()
local maxDistance = 5
local cd = 5
local mcd = 5
local function changeHair(target)
if cd == 0 then
game.ReplicatedStorage.ChangeHair:FireServer(target)
useAnim:Play()
script.Parent.Buzz:Play()
cd = mcd
end
end
local function checkClick(mouse)
local target = mouse.Target.Parent or mouse.Target.Parent.Parent
local distance = (target.HumanoidRootPart.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).Magnitude
if distance <= maxDistance then
print(distance, maxDistance)
changeHair(target)
end
end
tool.Activated:Connect(function()
checkClick(game.Players.LocalPlayer:GetMouse())
idleAnim:Play()
end)
while true do
if cd ~= 0 then
cd -= 1
end
wait(1)
end
My question is, how can I make this script remove the accessories when they get buzzed, while showing the new hairs?