Neviothr 102 Posted December 17, 2015 I'm trying to make so the player doesn't take damage while in vehicles, for some reason it doesn't work. This is how my script looks: while {true} do { if ((vehicle player == MGG) or (vehicle player == HAT1) or (vehicle player == HAT2) or (vehicle player == HAT3) or (vehicle player == M1131) or (vehicle player == M1132)) then { player allowDamage false; hint "You no longer take damage"; }; else { player allowDamage true; hint "You now take damage"; }; sleep 10;}; What am I doing wrong? Share this post Link to post Share on other sites
Maff 251 Posted December 17, 2015 while {true} do { waitUntil {((vehicle player == MGG) || (vehicle player == HAT1) || (vehicle player == HAT2) || (vehicle player == HAT3) || (vehicle player == M1131) || (vehicle player == M1132)}; player allowDamage false; hint "You can not take damage"; waitUntil {((vehicle player != MGG) || (vehicle player != HAT1) || (vehicle player != HAT2) || (vehicle player != HAT3) || (vehicle player != M1131) || (vehicle player != M1132)}; player allowDamage true; hint "You can now take damage"; }; 1 Share this post Link to post Share on other sites
f2k sel 164 Posted December 17, 2015 The above is missing a ) at the end of the waituntil condition check != M1132)}; should be != M1132))}; another way to do it while {true} do { waitUntil {vehicle player in [MGG,HAT1,HAT2,HAT3,M1131]}; player allowDamage false; hint "You can not take damage"; waitUntil {vehicle player == player}; player allowDamage true; hint "You can now take damage"; }; 2 Share this post Link to post Share on other sites
Neviothr 102 Posted December 18, 2015 Thank you both very much!! :) Share this post Link to post Share on other sites
PiZZADOX 47 Posted December 18, 2015 Remember that simply not allowing damage to the player doesn't mean the player wont die if the vehicle is disabled. If you wanted to make the player stay alive when the vehicle explodes, simply make an eventhandler for the vehicle that dumps players out of the vehicle over a certain amount of damage (_damage >= 0.91) 1 Share this post Link to post Share on other sites