Help with my jetpack script

I am making a game. Right now I have it so that whenever they press space fire comes out of the 3d model I welded to the character, but the player kinda gets stuck in the baseplate. Can anyone help? This is my script (not seeing any errors in output)
`local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
local character = player.Character

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local character = player.Character

local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(input, player)
    if input.UserInputType == Enum.UserInputType.Keyboard then
        if input.KeyCode == Enum.KeyCode.Space then
            character.UpperTorso.Jetpack.PE.Enabled = true
            while true do
                wait(.5)
                character:SetPrimaryPartCFrame(CFrame.new(0, 3, 0))
            end
        end
    end
end)

UIS.InputEnded:Connect(function(input, player)
    if input.UserInputType == Enum.UserInputType.Keyboard then
        if input.KeyCode == Enum.KeyCode.Space then
            character.UpperTorso.Jetpack.PE.Enabled = false
        end
    end
end)

Check if your jetpack is anchored or not? because from what I have seen, when something stucked in the baseplate most of it because of it is anchored.

Capture
This is a meshpart in ReplicatedStorage

Maybe record the video of you trying it? so I can see what’s wrong.

What do you expect this loop to do? It looks to me like it will glue the player to 0,3,0

here it is I didnt bother editing
edit: bro it had a error

That is what is happening how can I fix that?

It’s alright, I saw the loop and I think that’s the real problem.

how do I fix though? (characters hehe)

Is this your entire ‘jetpack’ script? Is it not a tool, is there no other script? If not, you have some work to do, you haven’t made a jetpack, you’ve made an accessory.

I just started on this game. But first I actually need to make the player fly

Okay well you should search for flying scripts and see if you can find something if you don’t know how to script it. I think a lot of them use the legacy body movers to accomplish this.

I have tried but really could not find anything related to this since I am not making like an hd admin fly script.

Maybe you could take some ideas from how this guy did it, he shared his script: