Part go foward and camera lock

Hello,
I wonder how I can make the “AvionPapier” Part move on its own towards the direction the player is looking, while forcing the player’s shift lock. These are the only two things that I cannot complete and despite my research, it is impossible for me to find how to force a player’s shiftlock (to deactivate and activate it when I want) and that the Part can move forward smoothly where the player is looking.

Scritps and infos :

ServerScriptService.Script )

game:GetService("Players").PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		game:GetService("ReplicatedStorage").ReEnableBackpack:FireClient(plr)
		char.Humanoid.Died:Connect(function()
			if plr.Character:FindFirstChild("Plane") then
				plr.Character:FindFirstChild("Plane"):Destroy()
			end
		end)
	end)
end)

game:GetService("ReplicatedStorage").Seat.OnServerEvent:Connect(function(plr)
	if plr then
		if plr.Character then
			if plr.Character:FindFirstChild("Plane") then
				plr.Character.Humanoid.JumpHeight = 0
				local a = plr.Character.HumanoidRootPart.CFrame
				plr.Character:FindFirstChild("Plane").AvionPapier.CFrame = a
				plr.Character:FindFirstChild("Plane").AvionPapier.Seat:Sit(plr.Character.Humanoid)
			end
		end
	end
end)

StarterPack.Plane.LocalScript )

script.Parent.Equipped:Connect(function()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
	game:GetService("ReplicatedStorage").Seat:FireServer()
end)

StarterPlayerScripts.Main )

game:GetService("ReplicatedStorage").ReEnableBackpack.OnClientEvent:Connect(function()
	game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
end)

Explorer )
image

1 Like