So I developed a SCI (self check-in) for roblox Spirit Airlines, we just had our inaugural today and also the first time my scripts were used by ~60 people in the span of 10 seconds, which caused the scripts to break, sometimes it would work halfway, where they would be named but not given their boarding pass, sometimes the script would actually function, and sometimes neither would happen and staff had to manually give them a boarding pass. I talked to a few friends who went to the flight and I came to the conclusion that it was mass request issues with the remote events, my script wasn't structured in the most efficient way because at the bottom I had repeat wait() until which I'm assuming was the issue, now I'm not really sure, but from what I've been thinking for the past hour or so is that, do you guys have any ideas for what caused this? My serverside (which is what everybody who wasn't checked in said, they got the screen saying they were, so the remote was fired)
My code is as follows:
local function test (Player,classes)
if classes == 1 then
Player.Character.Humanoid.DisplayName = Player.Name..' | Economy Boarding Group #'..current_boardinggroup
local card1clone = card1:Clone()
card1clone.Parent = Player.Backpack
warn('SCI -->> '..Player.Name..' checked into Economy boarding group '..current_boardinggroup)
economy_checkedin += 1
elseif classes == 2 then
Player.Character.Humanoid.DisplayName = Player.Name..' | Priority Access'
local card2clone = card2:Clone()
card2clone.Parent = Player.Backpack
warn('SCI -->> '..Player.Name..' checked into Priority Access')
elseif classes == 3 then
Player.Character.Humanoid.DisplayName = Player.Name..' | Big Front Seat'
local card3clone = card3:Clone()
card3clone.Parent = Player.Backpack
warn('SCI -->> '..Player.Name..' checked into Big Front Seat')
end
end
revent.OnServerEvent:Connect(test)
-->> Economy boarding zone/group things, this is where I'm assuming the issue is coming from
repeat wait() until economy_checkedin == group3cap
warn('SCI -->> Switching to boarding group 4.')
current_boardinggroup = 4
card1 = class1card_4
tl;dr How can I fix this script to be more efficient and work with a lot of requests at once because having a counter go up to 20 in like 10 seconds or so.
