I need help changing the players hair while inside the sphere or close after. I am making a DBZ game and need help changing the players hair. Another thing I should mention is that I am using a StarterCharacter in StarterPlayer if that makes a difference.
local p = game.Players.LocalPlayer --Get the localplayer
local char = p.Character
function onKeyPress(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.X then
local part = Instance.new("Part", workspace)
part.CanCollide = false
part.Anchored = true
part.Position = p.Character.HumanoidRootPart.Position
part.BrickColor = BrickColor.new("New Yeller")
part.Shape = "Ball"
part.formFactor = 'Symmetric'
part.Size = Vector3.new(10, 10, 10)
part.TopSurface = 0
part.BottomSurface = 0
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
part.Transparency = part.Transparency + 0.1
wait (0.05)
Tshirt "rbxassetid://451267133"
end
end
game:GetService("UserInputService").InputBegan:connect(onKeyPress)

3 comments
AddAccessory() is the way to go when adding accessories like hair. But if you want to change your hair you need to locate the accessory get it’s type so you know if it’s hair and change the mesh id inside of the Handle. (unless the handle is somehow a MeshPart)
Click here for the method: https://developer.roblox.com/en-us/api-reference/function/Humanoid/AddAccessory
Thank You Guys