Advertisement
WellSumo

Untitled

Jan 24th, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. -- Terrain Generation For FE
  2. if workspace:FindFirstChild("Generated") then
  3. workspace.Generated:Destroy()
  4. end
  5. local gen = Instance.new("Folder",workspace)
  6. gen.Name = "Generated"
  7. local lnd = Instance.new("Folder",gen)
  8. gen.Name = "Land"
  9. --workspace.Generated.Land:ClearAllChildren()
  10. local size = 60
  11. local bs = Vector3.new(4,4,4)
  12. local seedA = math.random(-1000000000,1000000000)/0.001
  13. local seedB = math.random(-1000000000,1000000000)/0.001
  14. local seedC = math.random(-1000000000,1000000000)/0.001
  15. local seedD = math.random(-1000000000,1000000000)/0.001
  16. local seedE = math.random(-1000000000,1000000000)/0.001
  17. local MSeed = math.random(-1000000000,1000000000)/0.001
  18. local clamp = 2
  19. local Mclamp = 250
  20. local threshA = math.random(100,750)/9000--5000 --math.random(20,40)/250
  21. local threshB = math.random(100,750)/9000
  22. local threshC = math.random(100,750)/9000
  23. local threshD = math.random(100,750)/9000
  24. local threshE = math.random(100,750)/9000
  25. local MThresh = math.random(100,1000)/100000
  26. local mult = math.random(20,100)/7.5--15
  27. local Mmult = math.random(20,400)
  28. for x = -size,size do
  29. for z = -size,size do
  30.  
  31. local yA = math.clamp(math.noise(x*threshA,z*threshA,seedA)*mult,-clamp,clamp)
  32. local yB = math.clamp(math.noise(x*threshB,z*threshB,seedB)*mult,-clamp,clamp)
  33. local yC = math.clamp(math.noise(x*threshC,z*threshC,seedC)*mult,-clamp,clamp)
  34. local yD = math.clamp(math.noise(x*threshD,z*threshD,seedD)*mult,-clamp,clamp)
  35. local yE = math.clamp(math.noise(x*threshE,z*threshE,seedE)*mult,-clamp,clamp)
  36.  
  37. local Moutain = math.clamp(math.noise(x*MThresh,z*MThresh,MSeed)*Mmult,0,Mclamp)---Mclamp,Mclamp)
  38.  
  39. local part = Instance.new("Part",lnd)
  40. part.Anchored = true
  41. part.BrickColor = BrickColor.new("Camo")
  42.  
  43. part.Position = Vector3.new(0,100,0) + Vector3.new(x,math.floor((yA+yB+yC+yD+yE+Moutain)),z) * bs
  44. part.Size = bs
  45. wait(0.05)
  46. end
  47. --wait()
  48. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement