-- LUA Script - precede every function and global member with lowercase name of script + '_main' -- Player Enters Zone ball_in_zone = {} zone_x_min = 0 zone_x_max = 0 zone_z_min = 0 zone_z_max = 0 function ball_zone_init(e) end function ball_zone_main(e) if zone_x_min == 0 then zone_x_min = g_Entity[e]['x'] - 220 zone_x_max = zone_x_min + 440 zone_z_min = g_Entity[e]['z'] - 220 zone_z_max = zone_z_min + 440 end if g_Entity[e]['plrinzone']==1 then if ball_in_zone ~= nil then -- PromptLocal (e, "Checking Balls") local total_balls = 0 local ball_count = 0 for k, v in pairs(ball_in_zone) do total_balls = total_balls + 1 if v == 1 then ball_count = ball_count + 1 end end -- PromptLocal (e, "Ball_Count=" .. ball_count ) Panel(46,40,54,48) TextCenterOnX(50,41,5, ball_count .. "/" .. total_balls ) if total_balls == ball_count then PlaySound(e,0) for k, v in pairs(ball_in_zone) do Destroy(k) end Destroy(e) end end end end