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

Script teleports character to hair instead?

The script is supposed to copy and weld the hair on the character's head like in the first screenshot below, but it just teleports the player to the hair and makes it stuck into the ground.

Script:

game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(char)
	

local plr = game.Players:FindFirstChild(char.Name) 

if player.Name == "Incinerxte" then 
plr.CanLoadCharacterAppearance = false 
local Shirt = Instance.new("Shirt",plr.Character)
Shirt.ShirtTemplate = "rbxassetid://6045025827"
local Pants = Instance.new("Pants",plr.Character)
Pants.PantsTemplate = "rbxassetid://4141596578"
local Hair = game.Workspace.MorphStuff.KakashiHair:Clone()
Hair.Parent = plr.Character
local Weld = Instance.new("Weld",Hair)
Weld.Part0 = Hair
Weld.Part1 = plr.Character.Head
Weld.C0 = CFrame.new(-0.25,-0.7,.23)
Weld.C0 = Hair.Weld.C0 * CFrame.Angles(0, math.rad(-180), 0)		
plr.Character.Head.face.Texture = "rbxassetid://4836643681" 
local BodyColors = Instance.new("BodyColors",plr.Character)
BodyColors.HeadColor = BrickColor.new("Light orange")
BodyColors.HeadColor3 = Color3.fromRGB(234,184,146)
BodyColors.LeftArmColor = BrickColor.new("Light orange")
BodyColors.LeftArmColor3 = Color3.fromRGB(234,184,146)
BodyColors.LeftLegColor = BrickColor.new("Light orange")
BodyColors.LeftLegColor3 = Color3.fromRGB(234,184,146)
BodyColors.RightArmColor = BrickColor.new("Light orange")
BodyColors.RightArmColor3 = Color3.fromRGB(234,184,146)
BodyColors.RightLegColor = BrickColor.new("Light orange")
BodyColors.RightLegColor3 = Color3.fromRGB(234,184,146)
BodyColors.TorsoColor = BrickColor.new("Light orange")
BodyColors.TorsoColor3 = Color3.fromRGB(234,184,146)


else if player.Name == "example" then 



	
	
	
			end
		end	
 	end)
end)

What it's supposed to look like: https://gyazo.com/3229c1114bdb8af00aff22c018257b19

What it looks like instead: https://gyazo.com/ad8e54b57b2623ec0442959051d65bdc

Any help?

5 comments

0

have you unanchor the hair

0

have you unanchor the hair

0

@Blackbooks yes i have

0

do you make the hair from union

0

@Blackbooks no, I also forgot to mention that the hair works in one game place (which is where I took the first screenshot) but when I moved it into another game it didn't work (the second screenshot) so idk what it is

1 answer

Here's a better solution: Use an Accessory. They are automatically welded to the player. Also, make sure your Hair is a mesh. I had to write this in here instead of Studio so sorry for bad formatting.

local Hair = game.Workspace.MorphStuff.KakashiHair:Clone()
local HairAccessory = Instance.new('Accessory')
local Handle = Instance.new('Part', HairAccessory)
Handle.Name = 'Handle'
Hair.Parent = Handle
local HairAttachment = Instance.new('Attachment')
HairAttachment.Name = 'HatAttachment'
HairAccessory.Parent = plr.Character

This might work, but if it doesn't, make the accessory manually. Then call plr.Character:AddAccessory(accessorypath) to add the accessory to your character

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