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

Welding a model to the players head, keep getting same error?

Ok so im making a skyrim ES-ish game and im making the khajiit head, and what I want is whenever the player touches the head it'll clone the model to the players head and they'll be walking around with it on y'know?

So here's the script inside the model

local FurHead = script.Parent
local touchpart = script.Parent.Nose
local debounce = false

touchpart.Touched:Connect(function(hit)
	
	
	if hit.Parent:FindFirstChild("Humanoid") then
		if not debounce then
			debounce = true
			
			
		local  head = hit.Parent.Head
	local NewHead = FurHead:Clone()
				
		-------------------------------------
		NewHead.Position = head.Position
		local weld = Instance.new("Weld")
		weld.Parent = NewHead
		weld.Part0 = head
		weld.Part1 = NewHead
		weld.C0 = CFrame.new(0,0.3,0.1)
			weld.C1 = head.HairAttachment.CFrame
			
			
			
		
		NewHead.Anchored = false
			NewHead.Name = "FurHead"
			
			NewHead.Script:Destroy()
			
		end
		wait(5) 
						debounce = false
		end


end)

I kept getting this error "Position is not a valid member of model" and I heard you need to set a basepart, so I set it as the "UpperJaw" which is a child of the model ofc

But I got the same error?

Is it because its anchored or its a model (Khajiit head) inside of another model? (Boy Rig)

I tried taking the position thing away but then it says "Expected basepart for model got weldpart1" when there already is a basepart?

1 answer

okay just let me rewrite this

local Head = script.Parent
local Touch = script.Parent.nose
Touch.Touched:Connect(function(p)
local player = game.Players:GetPlayerFromCharacter(p.Parent)
if player then
if not player.Character:FindFirstChild("sd.bbb :yes:") then
local clone = Head:Clone()
clone.Parent = player.Character
clone:SetPrimaryPartCFrame(player.Character.Head.CFrame)
clone.Name = "sd.bbb :yes:"
local w = Instance.new("WeldConstraint",clone)
w.Part0 = clone
w.Part1 = player.Character.Head
end
end
end)

there you go

5 comments

0

Says CFrame is not a valid member of model

0

Hello??

0

sorry for taking so long

0

i fixed it

0

can you add my discord Randy Butternubs #7224 so we can talk easier? it still isnt working right

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