#Get Infinite terrain height

1 messages · Page 1 of 1 (latest)

molten turret
#

if you need the height of the terrain on the server side or client side this is how you can do it

local terrainData = require(game.ReplicatedFirst.Terrain.Data.TerrainData)

local function GetHeight(x, z)
    local height = 0
    for i, data in ipairs(terrainData.noises) do
        local noise = math.noise(x / 4 * data[3], data[1], z / 4 * data[3])
        height += math.clamp(noise, data[4], data[5]) * data[2]
    end
    height += terrainData.shift
    height = math.clamp(height, terrainData.minimumHeight, terrainData.maximumHeight)
    return height
end


for i = 1, 100 do
    task.wait()
    local positionX = math.random(-100, 100)
    local positionZ = math.random(-100, 100)
    local positionY = GetHeight(positionX, positionZ)
    local part = Instance.new("Part")
    part.Anchored = true
    part.Position = Vector3.new(positionX, positionY, positionZ)
    part.Parent = workspace
end
tepid canopy
#

Wheres the module

molten turret
#

when you press save it will create the module

silent gale