Hi. I need to fix my script? I want to change body parts for player when player touched the block for R15 rig type.

function ChangeMe(hit)
	if hit.Parent == nil then return end
	if (hit.Parent:findFirstChild("HumanoidRootPart") == nil) then return end
	local human = hit.Parent:findFirstChild("HumanoidRootPart") 
	local char = hit.Parent
	local player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if (human ~= nil) and debounce == false then
		debounce = true
		originals = char:getChildren()
		for w = 1, #originals do
			if originals[w].className == "CharacterMesh" then
				originals[w]:remove()
			end
		end
		meshes = script:getChildren()
		for y = 1, #meshes do
			copy = meshes[y]:clone()
			copy.Parent = char
		end
	end
	debounce = false
end

script.Parent.Touched:connect(ChangeMe)

2 comments

0

Humanoid Root Par, you forgot to add the -t

1

Thanks for quick reply. the same doesn't work :(