So my problem is that whenever someone dies in the plane, they respawn with the same aircraft controls as if they were to still be flying the plane. This makes movement weird and their cursor is locked in the middle. I'm not sure what I did wrong in the script as I made it so that it deselects the tool whenever a player is out of the seat. If I could get some tips or solutions that would be great thanks!
function deselected(forced)
selected,script.Parent.CurrentSelect.Value = false,false
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
gui.Parent = nil
flying = false
pcall(function()
move.maxForce = Vector3.new(0,0,0)
if (taxi()) then
gyro.maxTorque = Vector3.new(0,0,0)
else
plane.Dead.Value = true
end
end)
if (forced) then
if (mouseSave) then
mouseSave.Icon = "rbxasset://textures\\ArrowCursor.png" -- If you remove a tool without the actual deselect event, the icon will not go back to normal. This helps simulate it at the least
wait()
end
script.Parent.Deselect1.Value = true -- When this is triggered, the Handling script knows it is safe to remove the tool from the player
end
end
script.Parent.Deselected:connect(deselected)
script.Parent.Deselect0.Changed:connect(function() -- When you get out of the seat while the tool is selected, Deselect0 is triggered to True
if (script.Parent.Deselect0.Value) then
deselected(true)
end
end)
