From 8c148ab93f574402420373a260a468bb1d469714 Mon Sep 17 00:00:00 2001 From: Alexsandro Percy Date: Sat, 22 Jan 2022 18:09:15 -0300 Subject: [PATCH] fix on detach passenger --- trike_utilities.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/trike_utilities.lua b/trike_utilities.lua index 39651e6..1ee47f8 100644 --- a/trike_utilities.lua +++ b/trike_utilities.lua @@ -148,11 +148,13 @@ function trike.dettach_pax(self, player) self._passenger = nil -- detach the player - player:set_detach() - player_api.player_attached[name] = nil - player_api.set_animation(player, "stand") - player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0}) - --remove_physics_override(player, {speed=1,gravity=1,jump=1}) + if player then + player:set_detach() + player_api.player_attached[name] = nil + player_api.set_animation(player, "stand") + player:set_eye_offset({x=0,y=0,z=0},{x=0,y=0,z=0}) + --remove_physics_override(player, {speed=1,gravity=1,jump=1}) + end end function trike.checkAttach(self, player)