Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Random terrain generater, Needhelp stopping it at a certain point Help?

Asked by 5 years ago

Her is the script

 local height = 20
local size = 50
local y = 0
local x = 0
function HowmanyPlaced()
    place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
place()
end

function place()
    local inst = Instance.new("Part", game.Workspace)
    inst.Anchored = true
    inst.BrickColor = BrickColor.new("Forest green")
    inst.Position = Vector3.new(0,0,0)+ Vector3.new(y,0,x)
    inst.Size = Vector3.new(size,math.random(1,height),size)
    inst.Material = "Grass"
    y = y+size

end
while true do
    HowmanyPlaced()


x=x+size
y=0
wait(0.1)
end

i need help STOPPING it at a certain point in time this took me a while to figure out and i cant find out how

0
Better yet question how do i stop a loop? Vortex_Vasne 89 — 5y
0
Wait im dumb for loops exist Vortex_Vasne 89 — 5y
0
imma keep this here for other people to use Vortex_Vasne 89 — 5y
0
xD Farsalis 369 — 5y
View all comments (3 more)
0
I'd recommend making your "function" in to "local function". Especially if you've got them firing on a loop. mbramblet 80 — 5y
0
Ok Vortex_Vasne 89 — 5y
0
maybe 'script.Disabled = true' NSMascot 113 — 5y

Answer this question