Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hey, can anyone tell me why this script won't work track the rounds and etc...?

Asked by 6 years ago

Hi, So I am making a survival game where the players (15 players are allowed in each server in case this is important) are in Jurassic World and they have to survive while the dinosaurs try to catch them. The way the game is set up is that there are two teams, the Tourists (survivors) and the Casualties (people who died). But here is where it gets a bit tricky, there technically three mini-rounds in each "round." The first lasts two minutes (120 seconds) and there are no dangers, the players can just walk around the park and look at the dinosaurs or find hiding spots or whatever. Then after the two minutes, the Dinosaurs "escape" out of their habitats/cages and the players have to try to avoid and or survive the dinosaurs from attacking and killing them, this round lasts 5 minutes (300 seconds). The final "round" is the same as the previous one except at the docks the two rescue boats appear and the players have to get to these boats to become safe, this round lasts 2 minutes (120 seconds). Every time a new mini round begins a GUI at the top appears saying what round it is (whether you can look around, have to run/survive, or if the boats appeared). There is also a quick 45-second intermission in between the end of the final mini-round and the beginning of a new game. The script below is my script that I thought should make all of this happen but for some reason when I play the game, the background of the GUI that tracks the rounds shows up but the text doesn't, the box is empty. The bolded script is the part that should make the GUI that announces who survived the previous round (all of the people on the Tourists team). That GUI should appear after the overall round/final mini-round ends and before the next Intermission begins but it also doesn't appear. Then finally the last part of the script, the italicized part, is what is supposed to make all of the players on the Casualties team change to be on the Tourists team during intermission and teleports them to the tourists spawn point but this doesn't work either. Can anyone tell me what I did wrong and help me fix it? Please comment below if you have any clarifying questions for me and I will respond as soon as I can. Thanks so much for all of your help, Skyraider5

local replicatedstorage = game:GetService("ReplicatedStorage") 
local status = replicatedstorage:WaitForChild("Time")
local i = 15,0,-1
local a = 1
while a < 10 do
    while game.Players.NumPlayers < 1 do 
        status.Value = "1 or more players are required to begin!"
        repeat wait(2) until game.Players.NumPlayers >= 1 
    end
    status.Value = "Intermission... "..i
    wait(.15)
    wait(1)
    status.Value = "Welcome To Jurassic World! Explore The Park!"
    wait(5)
    status.Value = "Emergency! Assests Out Of Containment! Get To Safety!"
    wait(10)
    status.Value = "The Rescue Boats Have Arrived! Get To The Docks!" 
    wait(5)
    status.Value = "The Island Has Been Evacuated! All Known Survivors Rescued!"
    wait(1)
    **local sg = game.StarterGui("ScreenGui")
    sg.Parent = game.Players.LocalPlayer.PlayerGui
    local winnerGui = sg.SurvivorsPage.Frame("WinnersList")
    winnerGui.AnchorPoint = Vector2.new(0.5,0.5)
    winnerGui.Position = UDim2.new(0.5,0,0.5,0)
    local list = Instance.new("UIListLayout")
    list.Padding = UDim.new(0,0)
    list.Parent = winnerGui
    local survivors = game:GetService("Teams").Tourists:GetPlayers()
    for _,v in pairs(survivors) do
    local newLabel = sg.winnerGui("TextLabel")
    newLabel.Text = v.Name
    newLabel.Size = UDim2.new(1,0,0,20)
    newLabel.Parent = winnerGui
    end
    winnerGui.Size = UDim2.new(0,250,0,20*#survivors)
    winnerGui.Parent = sg
    wait(8) --time gui stays open
    sg:Destroy()**

    *--this part moves players from Casualties team to Tourists team:
    local dead = game:GetService("Teams").Casualties:GetPlayers()
    for _,v in pairs(dead) do
    v.Team = game:GetService("Teams").Tourists
    end*

Answer this question