#🔧 Script Not Working – Trying to Spawn Tile Platform

1 messages · Page 1 of 1 (latest)

twin rivet
#

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

twin rivet
#

wait

leaden gazelleBOT
#

studio** You are now Level 1! **studio

twin rivet
tawny dune
#

you need to set its primarypart

#

a model does not have a position

twin rivet
#

ohhhh

tawny dune
#

i would use primarypartcframe

#

or

#

PivotTo