#Round

1 messages · Page 1 of 1 (latest)

summer mortar
#

im trying to make a shop system that implets tools in a folder called tools in replicated storage when round begings a nd takes tools away when round ends, im also trying to make it so one of the tools is already owned and u can equip 1 at a time. i just dont know how to make it cost currnacy cia leaderbord stats but make it save and implment during round

#

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local INTERMISSION_TIME = 6
local ROUND_TIME = 6
local MIN_PLAYERS = 1

local function TeleportPlayers(cframe)
local players = Players:GetPlayers()
for i, player in players do
if not player.Character then continue end

    player.Character:PivotTo(cframe)
end

end
--Dont touch basic stuff
local function Countdown(duration)
for i=duration, 1, -1 do
workspace:SetAttribute("Clock", i)
task.wait(1)
end
end

local function Intermission()
print("INTERMISSION")
workspace:SetAttribute("Status", "It's normal for") --the values for GUI
TeleportPlayers(workspace.SpawnLocation.CFrame * CFrame.new (0, 2, 0))
Countdown(INTERMISSION_TIME)

end

local function RunGame(map)
print("GAME BEGINS")
workspace:SetAttribute("Status", "It's random for") -- GUI VALUES
TeleportPlayers(map.Spawn.CFrame)
Countdown(ROUND_TIME)
map:Destroy()

end
--The infinite Loop for rounds
while true do
if #Players:GetPlayers() >= MIN_PLAYERS then
Intermission()

    workspace:SetAttribute("Status", "Loading map")
    local maps = ReplicatedStorage.Maps:GetChildren()
    local randomMap = maps [math.random(#maps)]
    local newMap = randomMap:Clone()
    newMap.Parent = workspace
    task.wait(1)

    RunGame(newMap)
else--If theres no Players
    print("WAITING FOR PLAYERS...")
    workspace:SetAttribute("Status", "Waiting for players...")
    task.wait(1)
end

end