Help with scripting a round based game

Hello!
I am working on a game where players spawn on these tiles, and every 10 seconds, something happens to a tile such as it might turn to lava, or it might start spinning etc.
How would I go about scripting the tiles?
I have many different ideas such as cloning the certain script (such as a fire script or lava script or spinning script) and putting the script in the certain tile, or I could use RemoteEvents for each thing that happens to a tile.
I am just not too sure.
What would you suggest is the safest way to script this?

tysm <3

1 Like

Hmm I’ll give an idea :thinking:

What you could do, is once the round starts you can teleport all the players using a for i, v in pairs loop to set the Character’s Position to where those tiles are

local TileArea = workspace.TileArea

for i, v in pairs(game.Players:GetPlayers()) do
    local Character = v.Character
    if Character then
        Character.HumanoidRootPart.Position = TileArea.SpawnPoint.Position + Vector3.new(math.random(-20, 20), 0, math.random(-20,20)) --This is to separate players from teleporting in the same area
    end
end

Next, you could go about the Tile Making a bunch of different ways, but what I’d think could be the best choice is to put your Tiles & Tile Changes in separate tables and putting it inside a loop:

local Tiles = workspace.Tiles:GetChildren()
local TileChanges = {
    "LavaTile";
    "SpinTile";
    "ExplodeTile";
}

while true do
    local RandomTile = Tiles[math.random(1, #Tiles)]
    local RandomChange = TileChanges[math.random(1, #TileChanges)]

    if RandomTile and RandomChange then
        if RandomChange == "LavaTile" then
        --Ow that's hot
    elseif RandomChange == "SpinningTile" then
        --SPEEEEEEEEEEN
    elseif RandomChange == "ExplodeTile" then
        --The tile is a bomb
        end
    end
    wait(5)
end

Usually you’d want to set Round Scripts mainly on the server-side, it’s more secure that way :wink: