local old_anglex = {} local old_angley = {} local old_anglez = {} local max_health = {} local state = {} local reset_delay = 3000 --delay timer for standing back up local fall_speed = 1 --(set to negative (-1) to fall in opposite direction) local fall_axis = "z" --set to "x" / "y" or "z" depending on the axis you want to use function target_practice_board_init(e) state[e] = "ready" end function target_practice_board_main(e) if max_health[e] == nil then max_health[e] = g_Entity[e]['health'] old_anglex[e] = g_Entity[e]['anglex'] old_angley[e] = g_Entity[e]['angley'] old_anglez[e] = g_Entity[e]['anglez'] return end --Prompt(g_Entity[e]['anglex'].." "..g_Entity[e]['anglez']) if state[e] == "ready" then CollisionOn(e) if g_Entity[e]['health'] < 1 then state[e] = "fall" end elseif state[e] == "fall" then CollisionOff(e) if GetTimer(e) > 1 then StartTimer(e) if fall_axis == "x" then if g_Entity[e]['anglex'] < 90 then SetRotation(e,g_Entity[e]['anglex']+fall_speed,g_Entity[e]['angley'],g_Entity[e]['anglez']) else state[e] = "wait" end elseif fall_axis == "y" then if g_Entity[e]['angley'] < 90 then SetRotation(e,g_Entity[e]['anglex'],g_Entity[e]['angley']+fall_speed,g_Entity[e]['anglez']) else state[e] = "wait" end elseif fall_axis == "z" then if g_Entity[e]['anglez'] < 90 then SetRotation(e,g_Entity[e]['anglex'],g_Entity[e]['angley'],g_Entity[e]['anglez']+fall_speed) else state[e] = "wait" end end end elseif state[e] == "wait" then SetEntityHealth(e,max_health[e]) if GetTimer(e) > reset_delay then StartTimer(e) state[e] = "reset" end elseif state[e] == "reset" then SetRotation(e,old_anglex[e],old_angley[e],old_anglez[e]) state[e] = "ready" end end