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

Would I be able to make this move?

I have a script that morphs the player into a model. How would I make the player move? It seems to be anchored to one spot and I can't even move the camera.

local MorphName = "Derac" 
local MorphDirectory = game.ServerStorage 



script.Parent.MorphButton.MouseButton1Down:connect(function()
	local Character = game.Players.LocalPlayer.Character
	if Character then
		local TorsoPos = Character.Torso.CFrame.p
		Character:ClearAllChildren()
		local MorphClone = MorphDirectory[MorphName]:Clone()
		for _,v in next,MorphClone:GetChildren() do
			v.Parent = Character
		end
		Character:MoveTo(TorsoPos)
		for x = 1,3 do
			Character:MakeJoints()
		end
		for _,v in next,Character:GetChildren() do
			if v.Anchored == true then
				if v:IsA("BasePart") then
					v.Anchored = false
				end
			end
		end
		wait()
		MorphClone:remove()
	end
end)

1 answer

script.Parent.MorphButton.MouseButton1Down:connect(function()
local Character = game.Players.LocalPlayer.Character
	if Character then
		local TorsoPos = Character.Torso.CFrame.p
		Character:ClearAllChildren()
		local MorphClone = MorphDirectory[MorphName]:Clone()
			for _,v in next,MorphClone:GetChildren() do
				v.Parent = Character
			end
				Character:MoveTo(TorsoPos)
			for x = 1,3 do
				Character:MakeJoints()
			end
			for _,v in next,Character:GetChildren() do
				if v.Anchored == true then
					if v:IsA("BasePart") then
						v.Anchored = false
					end
				end
			end
		wait()
		MorphClone:remove()
	end
end)

Please use the Code Block next time for your script, it is very hard to read. This is for people if they want to read it easier.

1 comment

0

Thank you very much. Sorry about that!

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