game:GetService("Players").PlayerAdded:Connect(function(player) local flying = Instance.new("BoolValue",player) flying.Name = "flying" flying.Value = false end) local event = game:GetService("ReplicatedStorage"):WaitForChild("fly_broom") local work = game:GetService("Workspace") event.OnServerEvent:Connect(function(player,command) if player.flying.Value == false then return end local bodyforce local sit for i,v in pairs(work:GetChildren()) do if v.Name:split("'")[1] == player.Name and not v:FindFirstChild("Humanoid") then if v.sit:FindFirstChild("BodyPosition") then bodyforce = v.sit.BodyPosition sit = v.sit end end end if command == "W" then bodyforce.Parent.flying.Disabled = false elseif command == "Ended" then if not bodyforce then return end bodyforce.Parent.flying.Disabled = true elseif command == "space" then for i,v in pairs(bodyforce.Parent.Parent:GetChildren()) do v.CanCollide = true local turned = false end local model = sit.Parent sit.Touched:Connect(function() sit.Anchored = true sit.Orientation = Vector3.new(0, 0, -32.83) --ive tried with model:SetPrimaryPartCFrame(CFrame.Angles(numbers)) but this only put my model somewhere completely else so idk how to rotate end) bodyforce:Destroy() player.Character.HumanoidRootPart.WeldConstraint:Destroy() wait(3) player.flying.Value = false end end)
Assign a PrimaryPart to the model (property of model) and use the :SetPrimaryPartCFrame() method.
https://developer.roblox.com/en-us/api-reference/function/Model/SetPrimaryPartCFrame