#map generate

1 messages · Page 1 of 1 (latest)

buoyant swift
#

i wrote this down

first = workspace["default area"].SpawnLocation
regendef = workspace.Grids.three
function plateclone(xdemand,zdemand)
    for xrod = 0, xdemand, 1 do
        third = regendef:Clone()
        third.Anchored = true
        third.Position = first.Position + Vector3.new(0,0,xdemand)
        for zrod = 0, zdemand, 1 do
        task.wait(0.1)
        second = regendef:Clone()
        second.Parent = workspace.map
        second.Anchored = true
        second.Position = first.Position
        second.Position = second.Position + Vector3.new(1*zdemand,0,0)
        end
    end
end
plateclone(10,10)
``` but it not doing what i wanted
quick storm
buoyant swift
#

like this

#

uhh

#

no

#

spawn a plate in like

#

x 1 x 2 x 3 x 4
then next row

#

untill finishes

quick storm
#

Ok one sec

#
local plate = --plate location

function spawnPlates(x,y)
    for row = 0, x do
        for column = 0, y do
               local clone = plate:Clone()
               clone.parent = Workspace
               clone.position = Vector3.new((row * plate.Size.x), 0, (column * plate.Size.y))
        end
    end
end
spawnPlates(4, 4)
#

Try that

#

Im on my phone so it might be broken

#

Wait I forgot something

#
local plate = --plate location

function spawnPlates(x,y)
    for row = 0, x do
        for column = 0, y do
               local clone = plate:Clone()
               clone.parent = Workspace
               clone.position = Vector3.new((row * plate.Size.x) + (plate.Size.x/2), 0, (column * plate.Size.y) + (plate.Size.y/2))
        end
    end
end
spawnPlates(4, 4)
#

Ok that should work

#

I don't quite understand how you have the Workspace setup so feel free to ask anything to modify for your setup

buoyant swift
#

alright

#

alright i modified it to this

local plate = workspace.Grids.three

    function spawnPlates(x,y)
        for row = 0, x do
            for column = 0, y do
                local clone = plate:Clone()
                clone.parent = Workspace.map
                clone.position = Vector3.new((row * plate.Size.x) + (plate.Size.x/2), 0, (column * plate.Size.y) + (plate.Size.y/2))
            end
        end
    end
spawnPlates(4, 4)
```it gives error **parent is not a valid member of Part "three"**
also do i need remove local if i want everyone to see it
quick storm
#

No

#

If you want everyone to see it make sure it's a server script

buoyant swift
#

uhh it's

quick storm
#

Make clone .parent to be .Parent

buoyant swift
#

Ok

quick storm
#

That should fix it

buoyant swift
#

alright capitalized it
just uhh it only spawn 1 row

#

do i delete local to make everyone see

quick storm
#

No

buoyant swift
#

uh

#

i only need fit it inside server script

#

and it works

#

?

quick storm
#

If it's in a server script it runs on the server which means it sends it to all clients

#

Local is just like how you define a variable

buoyant swift
#

right?

quick storm
#

Local script makes only you see it

#

A local variable is something different

#

It means it's only in that script

#

It's locally in the sever script

quick storm
# buoyant swift

Is your old script running and the new script at the same time?

#

Ohhh found the problem

#

Dang 3d printing making switch up axis

#
local plate = --plate location

function spawnPlates(x,y)
    for row = 0, x do
        for column = 0, y do
               local clone = plate:Clone()
               clone.parent = Workspace
               clone.position = Vector3.new((row * plate.Size.X) + (plate.Size.X/2), 0, (column * plate.Size.Z) + (plate.Size.Z/2))
        end
    end
end
spawnPlates(4, 4)
#

Try that

buoyant swift
#

alright

#

hold

quick storm
#

Im holding

buoyant swift
#

sry went toilet

#

alright

#

it works