I am trying to make a cobblestone script, that puts lots of Stones on a part in a cobblestone-like arrangement, they are 3 bricks long, 1 high, 1 deep. It says
function Cobblestone(Part)
local Position_X = Part.Position.X
local Position_Y = Part.Position.Y
local Position_Z = Part.Position.Z
local Width = Part.Size.X
local Height = Part.Size.Y
local Length = Part.Size.Z
local Rotation_X = Part.Rotation.X
local Rotation_Y = Part.Rotation.Y
local Rotation_Z = Part.Rotation.Z
local Starting_Point_X = Position_X - (Width/2) -- Far side
local Starting_Point_Z = Position_Z - (Length/2) -- Far Side
local Across = math.floor(Width/3) -- How many stones, per row (3 studs long)
local Depth = math.floor(Length) -- How many Columns of stones
for a = 0, Depth do
for b = 0, Length do
local Stone = game.Lighting.Stone:Clone()
Stone.Position.X = (Starting_Point_X + 0.2) + b*1.5 -- Bottom Corner + 0.2 + Half the Stones' width
Stone.Position.Y = Position_Y + (Height/2) + 0.3 -- 0.3 studs above the surface of the part
Stone.Position.Z = (Starting_Point_Z + 0.2) + a*1.2 -- Moving back after 7 times
Stone.Rotation.X = Rotation_X + math.random(-2, 2)
Stone.Rotation.Y = Rotation_Y + math.random(-2, 2)
Stone.Rotation.Z = Rotation_Z + math.random(-2, 2)
Stone.Anchored = true
end
end
end
Cobblestone(game.Workspace.Path)
Output:
11:38:35.374 - X cannot be assigned to
11:38:35.375 - Script 'Workspace.Stoning', Line 23 - global Cobblestone
11:38:35.376 - Script 'Workspace.Stoning', Line 36
11:38:35.376 - Stack End
