Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Services
- local replicatedStorage = game:GetService("ReplicatedStorage")
- local serverStorage = game:GetService("ServerStorage")
- local values = replicatedStorage:WaitForChild("Values")
- local status = values:WaitForChild("Status")
- local hitbox = serverStorage:WaitForChild("Hitbox")
- local iceBox = serverStorage:WaitForChild("IceBox")
- local map = workspace.Map
- local contestants = {}
- -- Functions
- local function issoldier(plr)
- for _, v in pairs(contestants) do
- if v == plr then
- return true
- end
- end
- return false
- end
- local function kickOut(plr)
- for i, soldier in pairs(contestants) do
- if soldier == plr then
- table.remove(contestants,i)
- end
- end
- end
- local function chooseTagger(plrs)
- return plrs[math.random(1,#plrs)]
- end
- local function teleportPlayers(spawns)
- return spawns[math.random(1,#spawns)]
- end
- -- main
- while wait(1) do
- contestants = {}
- repeat
- status.Value = "Not enough players start!"
- wait(1)
- print("not enough players!")
- until #game.Players:GetPlayers() >= 1
- wait(1)
- status.Value = "New round starting!"
- for i, plr in pairs(game.Players:GetPlayers()) do
- if plr then
- table.insert(contestants,plr)
- end
- end
- contestants = (game.Players:GetPlayers())
- wait(4)
- local chosenTagger = chooseTagger(contestants)
- status.Value = "The chosen tagger is "..chosenTagger.Name
- if issoldier(chosenTagger) then
- kickOut(chosenTagger)
- end
- wait(3)
- local spawns = teleportPlayers(map.Spawns:GetChildren())
- for i, char in pairs(contestants) do
- if char.Character then
- char.Character.HumanoidRootPart.CFrame = spawns.CFrame + Vector3.new(0,10,0)
- end
- end
- for i = 10,0,-1 do
- status.Value = "The tagger will spawn in ("..i..")"
- wait(1)
- end
- chosenTagger.HumanoidRootPart.CFrame = map.TaggerSpawn.CFrame + Vector3.new(0,10,0)
- status.Value = "The tagger as spawned!!"
- local newHitbox = hitbox:Clone()
- newHitbox.Parent = workspace
- newHitbox.CFrame = chosenTagger.HumanoidRootPart.CFrame
- local weld = Instance.new("WeldConstraint",hitbox)
- weld.Part0 = hitbox
- weld.Part1 = chosenTagger.HumanoidRootPart
- end
Advertisement
Add Comment
Please, Sign In to add comment