Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local clicker = script.Parent
- local cs = game:GetService("CollectionService")
- local signIn = clicker.Parent.Parent
- local placeName = signIn.Configuration.PlaceName.Value
- local rs = game:GetService("ReplicatedStorage")
- local purgeBattleRe = rs:WaitForChild("PurgeBattleRe")
- local placeId = signIn.Configuration.PlaceId.Value
- local snd = signIn.Announcement
- local battleLbl = signIn.Wall.SurfaceGui.BattleLbl
- local ts = game:GetService("TeleportService")
- clicker.MouseClick:Connect(function(player)
- local tag = cs:HasTag(player, placeName)
- if tag then
- print("remove player in the queue", player.Name)
- purgeBattleRe:FireClient(player, false)
- cs:RemoveTag(player, placeName)
- else
- print("add player to the queue", player.Name)
- purgeBattleRe:FireClient(player, true)
- cs:AddTag(player, placeName)
- end
- end)
- while true do
- local lst = cs:GetTagged(placeName)
- print("lst = ", lst)
- if lst and #lst > 0 then
- snd:Play()
- for i=10, 1, -1 do
- print("count down = ", i)
- battleLbl.Text = "The " .. placeName .. " is starting in "
- .. i .. " seconds with " .. #lst .. " players"
- wait(1)
- lst = cs:GetTagged(placeName)
- if #lst == 0 then
- break
- end
- end
- if #lst > 0 then
- battleLbl.Text = "Teleporting... "
- local code = ts:ReserveServer(placeId)
- ts:TeleportToPrivateServer(placeId, code, lst)
- wait(6)
- end
- end
- wait(1)
- battleLbl.Text = "The Purge Battle!"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement