Hey! I'm new to Roblox Studio and I'm trying to follow a tutorial to generate a platform made of tiles using a script.
I placed a tile part in ReplicatedStorage and wrote this script inside ServerScriptService, but it's not working and nothing shows up when I play.
Can someone please check what's wrong with my script? I’ll drop it below. 🙏
local tileTemplate = game.ReplicatedStorage:WaitForChild("Tile")
local tilePlatform = Instance.new("Model")
tilePlatform.Name = "TilePlatform"
tilePlatform.Parent = workspace
-- Grid settings
local rows = 8
local columns = 8
local tileSize = 6
local startX = -((columns * tileSize) / 2)
local startZ = -((rows * tileSize) / 2)
local heightY = 20
-- Create grid
for row = 0, rows - 1 do
for col = 0, columns - 1 do
local tile = tileTemplate:Clone()
tile.Position = Vector3.new(startX + col * tileSize, heightY, startZ + row * tileSize)
tile.Anchored = true
tile.CanCollide = true
tile.Parent = tilePlatform
end
end
** You are now Level 1! **