How to make jojo pilot mode?

I was trying to create a ability of player control their stand moving around, i tried but i make something like this , i want it to be u legit controlling your stand.

local rep = game:GetService("ReplicatedStorage")
local deb = game:GetService("Debris")
local ServerStorage = game:GetService("ServerStorage")
local Players = game:GetService("Players")

local WalkSpeed = 5

rep.StandRemotes["White Snake"]["Pilot Mode"].OnServerEvent:Connect(function(player)
	local char = player.Character
	local Stand = char:FindFirstChild("Stand")
	if char:FindFirstChild("UsingMove").Value == false then
		if Stand then
			if not char:FindFirstChild("Piloting") then
				local DomineSFX = script.DomineVoice:Clone()
				DomineSFX.Parent = char.PrimaryPart
				DomineSFX:Play()
				
				char.PrimaryPart.Anchored = true
				char:FindFirstChild("UsingMove").Value = true
				
				DomineSFX.Ended:Wait()
				if char:FindFirstChild("UsingMove").Value == true then
					char.PrimaryPart.Anchored = false
					char:FindFirstChild("UsingMove").Value = false

					local RemoteSummon = script.RemoteSummon:Clone()
					RemoteSummon.Parent = char.PrimaryPart
					RemoteSummon:Play()
					deb:AddItem(RemoteSummon,5)
					deb:AddItem(DomineSFX,5)

					local PilotingValue = Instance.new("BoolValue")
					PilotingValue.Parent = char
					PilotingValue.Name = "Piloting"

					local Part = Instance.new("Part")
					Part.Parent = workspace
					Part.CFrame = char.HumanoidRootPart.CFrame
					Part.Anchored = true
					Part.Name = char.Name.. "Piloting"
					Part.Transparency = 1

					Stand:FindFirstChild("HumanoidRootPart").CFrame = char.PrimaryPart.CFrame * CFrame.new(0,0,-3)
					char:FindFirstChild("HumanoidRootPart").CFrame = Stand.PrimaryPart.CFrame
					char.PrimaryPart:FindFirstChildWhichIsA("Attachment"):Destroy()
					char:FindFirstChildWhichIsA("Humanoid").WalkSpeed = WalkSpeed

					local weld = Instance.new("WeldConstraint")
					weld.Parent = char.HumanoidRootPart
					weld.Part0 = char.HumanoidRootPart
					weld.Part1 = Stand.HumanoidRootPart

					local PilotVFX = script.SummonVFX.Attachment:Clone()
					PilotVFX.Parent = Stand.HumanoidRootPart
					PilotVFX.c:Emit(350)
					deb:AddItem(PilotVFX,3)

					for i, v in pairs(char:GetChildren()) do
						if v:IsA("BasePart") then
							v.Transparency = 1
						end
					end

					for i, v in pairs(char:GetDescendants()) do
						if v:IsA("Decal") then
							v.Transparency = 1
						end
					end

					for i, v in pairs(char:GetChildren()) do
						if v:IsA("Accessory") then
							v.Handle.Transparency = 1
						end
					end

					for i, v in pairs(char:GetDescendants()) do
						if v:IsA("ParticleEmitter") then
							v:Destroy()
						end
					end
				end
			else
				if char:FindFirstChild("Piloting") then
					char:FindFirstChild("Piloting"):Destroy()
					
					char:FindFirstChildWhichIsA("Humanoid").WalkSpeed = 10
					char.HumanoidRootPart.Anchored = true
					
					local DomineSFX = script.Return:Clone()
					DomineSFX.Parent = char.PrimaryPart
					DomineSFX:Play()
					
					DomineSFX.Ended:Wait()
					
					local DomineSFXx = script.RemoteDesummon:Clone()
					DomineSFXx.Parent = char.PrimaryPart
					DomineSFXx:Play()
					
					deb:AddItem(DomineSFX,5)
					deb:AddItem(DomineSFXx,5)
					
					local MoveTween = game:GetService("TweenService"):Create(char.HumanoidRootPart , TweenInfo.new(3), {CFrame = game.Workspace:FindFirstChild(char.Name.. "Piloting").CFrame * CFrame.new(0,2,0)})
					MoveTween:Play()
					MoveTween.Completed:Connect(function()
						
						local backvfx = script.BackVFX.Attachment:Clone()
						backvfx.Parent = char.PrimaryPart
						deb:AddItem(backvfx,5)
						
						for i, v in pairs(backvfx:GetChildren()) do
							if v:IsA("ParticleEmitter") then
								v:Emit(1000)
							end
						end
						
						Stand:Destroy()
						char.HumanoidRootPart.Anchored = false
						game.Workspace:FindFirstChild(char.Name.. "Piloting"):Destroy()
						
						for i, v in pairs(char:GetChildren()) do
							if v:IsA("BasePart") then
								v.Transparency = 0
								task.wait()
								char.HumanoidRootPart.Transparency = 1
							end
						end

						for i, v in pairs(char:GetDescendants()) do
							if v:IsA("Decal") then
								v.Transparency = 0
							end
						end

						for i, v in pairs(char:GetChildren()) do
							if v:IsA("Accessory") then
								v.Handle.Transparency = 0
							end
						end
						
						for i, v in pairs(char.PrimaryPart:GetChildren()) do
							if v:IsA("Attachment") then
								v:Destroy()
							end
						end
						
					end)
					
				end
			end
		end
	end
end)
2 Likes