-- --[[ RoBomb - made by Wat3rless [ Known as Water Aura ] ============================================== I based this game off the Garry Mod's Melon Bomber, though that came from Bomberman! Essentially you spawn into the arena and you left-click to set off a bomb! Changelog - 4/1 - Grid Generator added - Generates a Grid! 4/2 - Bomb Tool added - Bomb Tool man 4/3 - Bomb Tool Revised + Revamped - No bugs! 4/4 - GUI is being worked on - Help Menu - DONE! - Score Keeper - X - Store - X - Powerup keeper - X - Ad System // BUY A NOADPLS Gamepass to not see these horrid ads! - X 4/5 - Powerup System being worked on - Powerups : - Nuclear Bomb - Clears a row - Bigger Bomb - Expands the radius to 2 - More Bombs - Allows you to place more bombs! - Speed Bomb - Limit system ]] -- local function generateGrid(size, blocksize, position, name, parent, bool) if bool then if parent:findFirstChild(name) then parent[name]:Destroy() end end local grid = Instance.new("Model", parent) grid.Name = name local function tag(tagName, tagString, parent) local tagObject = Instance.new("StringValue", parent) tagObject.Name = tagName tagObject.Value = tagString end local function block(name, parent, position, brickcolor, transparency, cancollide, tagString, x, y) local part = Instance.new("Part", parent) part.Name = name part.BrickColor = brickcolor part.Transparency = transparency part.Size = Vector3.new(blocksize, blocksize, blocksize) part.Position = position part.CanCollide = cancollide part.Anchored = true part.TopSurface = 0 part.BottomSurface = 0 tag("Tag", tagString, part) tag("X", x, part) tag("Y", y, part) return part end tag("gridSize", size, grid) size = size % 2 == 0 and size + 1 or size for x = 1, size do coroutine.resume(coroutine.create(function() for y = 1, size do coroutine.resume(coroutine.create(function() local defaultPos = position + Vector3.new(x * blocksize, blocksize, y * blocksize) if not (x == 1 or y == 1 or x == size or y == size) then if x % 3 == 1 and y % 3 == 1 then block("IndestructableBlock", grid, defaultPos, BrickColor.new("Black"), 0, true, "idg", x, y) elseif not (math.random(1,2) == math.random(1,2)) then block("Block", grid, defaultPos, BrickColor.new("Bright blue"), 0, true, "d", x, y) else block("IndestructableBlock", grid, defaultPos, BrickColor.new("White"), 1, false, "id", x, y) end else block("IndestructableBlock", grid, defaultPos, BrickColor.new("Black"), 0, "idg", x, y) end end)) end end)) end return grid end local function getPlayers() return game:GetService("Players"):players() end local temp = Instance.new("Hint", workspace) local function log(message) temp.Text = message end local function getRandomSpawnLocation(grid) local spawnLocs = {} for index, object in next, grid:GetChildren() do if object:findFirstChild("Tag") then if object:findFirstChild("Tag").Value == "id" then table.insert(spawnLocs, object) end end end return spawnLocs[math.random(1, #spawnLocs)] end local function newGame(playerAmount, timeLimit) local function playerFunction(players, func) for index, player in next, players do coroutine.resume(coroutine.create(function() func(player) end)) end end local function toggleFreeze(players, bool) playerFunction(players, function(player) local character = player.Character if character ~= nil and character:findFirstChild("Torso") and character:findFirstChild("Humanoid") then character.Torso.Anchored = bool character.Humanoid.WalkSpeed = bool and 0 or 16 end end) end local function copyItem(object, parent) object:clone().Parent = parent end local function removeFromTable(playerTable, object) for index, tableObject in next,playerTable do if tableObject == object then table.remove(playerTable, index) return index end end end repeat log("Need " .. playerAmount - #getPlayers() .. " player(s) to start the game!") wait() until #getPlayers() >= playerAmount for time = 30, 0, -1 do log("The game will start in " .. time .. " seconds!") wait(1) end local playing = getPlayers() local time = 0 log("The game will be starting, setting up grid!") local grid = generateGrid(#playing * 6, 5, Vector3.new(0,0,0), "Grid", workspace, true) playerFunction(playing, function(player) local character = player.Character if character ~= nil and character:findFirstChild("Torso") then character:findFirstChild("Torso").CFrame = getRandomSpawnLocation(grid).CFrame end end) wait() toggleFreeze(playing, true) log("GET READY!") --playsound? 3 2 1 GO! wait(1) for time = 3, 0, -1 do log(time == 0 and "GO!" or time) wait(1) end playerFunction(playing, function(player) local character = player.Character if character:findFirstChild("Humanoid") then character.Humanoid.Died:connect(function() removeFromTable(playing, player) end) end copyItem(script:findFirstChild("bombScript"), player:findFirstChild("Backpack")) end) toggleFreeze(playing, false) repeat time = time + 1 wait(1) until time >= timeLimit or #playing <= 1 log(#playing == 1 and "There was a winner, his/her name is " .. tostring(playing[1]) .. "!" or (time >= timeLimit and "Time limit was up, no one won!" or "There was a draw!")) grid:Destroy() playerFunction(playing, function(player) local character = player.Character if character ~= nil then character:BreakJoints() end end) wait(3) for time = 5, 0, -1 do log("Waiting for cleanup " .. time .. " seconds left!") wait(1) end newGame(playerAmount, timeLimit) end newGame(2, 180)