Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lq = require(Workspace.LQuery)
- local testing = true
- local maps = {
- map1 = {
- Vector3.new(0, 0, 50),
- Vector3.new(50, 0, 0),
- Vector3.new(50, 0, 50),
- Vector3.new(-50, 0, 0)
- }
- }
- lq("alert").setDefaultFlags({
- backgroundTransparency = 0.5,
- backgroundColor = Color3.new(0.2, 0.2, 0.2),
- fontColor = "white",
- fontSize = Enum.FontSize.Size18,
- font = Enum.Font.Legacy,
- pause = true
- })
- while wait() do
- if not testing then
- while game.Players.NumPlayers < 3 do
- lq(game.Players).alert("Atleast 3 players are needed to start!", 1)
- end
- end
- local players = game.Players:GetPlayers()
- local killer = lq(players).rand()
- local map = lq(game.ServerStorage.Maps:GetChildren()).rand()
- lq(players).alert("A round is about to begin, choosing killer...", 4)
- lq(players).alert("The killer is " .. killer.Name .. "!", 3)
- lq(players).alert("Starting round..", 3)
- local activePlayers = lq(players).copy()
- local spawns = lq(maps[map.Name:lower()]).copy()
- local killerDead, result;
- local deathConnect = function(player)
- print(player.Name)
- lq(activePlayers).rid(player)
- if player.Name == killer.Name then
- killerDead = true
- end
- end
- lq(activePlayers).each(function(_, player)
- local spawn = lq(spawns).rand()
- lq(spawns).rid(spawn)
- player.Character:MoveTo(spawn)
- lq(player.Character.Humanoid).listen("die", function()
- deathConnect(player)
- end)
- end)
- lq(game.Players).listen("leave", function()
- deathConnect(player)
- end)
- for timer = 60, 1, -1 do
- lq(players).alert(timer, 1, {
- top = true,
- backgroundTransparency = 1
- })
- if #activePlayers < 2 or killerDead then
- result = killerDead and "win" or "lose"
- break
- end
- end
- if result == "win" then
- lq(players).alert("The survivors killer the murderer!", 4)
- elseif result == "lose" then
- lq(players).alert("The murderer killed all the survivors!", 4)
- else
- lq(players).alert("There was a tie!", 4)
- end
- lq(activePlayer).each(function(_, this)
- this.Character:BreakJoints()
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment