so i am working on a plane game with planes you can destroy by flying it into walls and i want to make the physics realistic like if one of my propeller breaks or one of my wings breaks the plane stops flying but ive tried much and i dont know what to do here is some of my script it also counts when the wing is detected to fall off
local Players = game:GetService("Players")
local function handleMissingWings()
for _, player in ipairs(Players:GetPlayers()) do
print("Checking wings for player:", player.Name)
local character = player.Character
if character then
local humanoid = character:FindFirstChildOfClass("Humanoid")
if humanoid and humanoid.SeatPart then
local planeModel = humanoid.SeatPart.Parent
if planeModel and planeModel:IsA("Model") then
local Wing1 = planeModel:FindFirstChild("Wing1")
local Wing2 = planeModel:FindFirstChild("Wing2")
if not (Wing1 and Wing2) then
print("Wings missing, initiating fall for player:", player.Name)
-- Wings are missing, forcefully stop the plane
local body = planeModel:FindFirstChild("Body")
if body and body:IsA("BodyVelocity") then
body:Destroy()
end
local bodyVelocity = Instance.new("BodyVelocity", body)
bodyVelocity.Velocity = Vector3.new(0, -30, 0) -- Set a downward velocity (adjust as needed)
end
end
end
end
end
end
while true do
handleMissingWings()
wait(1) -- Check every second (adjust as needed)
end
this script only works when you have your wing off and land the plane and jump out and jump in the plane again than it does work because it doesn’t let you go up