DuckyHacks4Sale

Island rip

Dec 30th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.39 KB | None | 0 0
  1. script/
  2. mod = Instance.new("Model")
  3. mod.Parent = game.Workspace.Base
  4. mod.Name = "GenScip"
  5. scale = 10
  6. char1 = {"Dark green", "part", 0, true, scale/2.5}
  7. char2 = {"Reddish brown", "clif", 0, true, scale*1.5,scale*2}
  8. char3 = {"23", "wate", 0.6, false, scale/2.5}
  9. char4 = {"Pastel brown", "sand", 0, true, scale/2.5}
  10. x = 0
  11. z = -100
  12. n1 = 0
  13. n2 = 0
  14. n3 = 0
  15. zonlay = math.random(1,3)
  16. if zonlay == 1 then
  17. n1 = math.random(1,30)
  18. n2 = math.random(40,50)
  19. n3 = math.random(60,100)
  20. end
  21. if zonlay == 2 then
  22. n1 = math.random(60,100)
  23. n2 = math.random(40,50)
  24. n3 = math.random(10, 30)
  25. end
  26. if zonlay == 3 then
  27. n1 = math.random(30,60)
  28. n2 = math.random(1,20)
  29. n3 = math.random(70,100)
  30. end
  31. spawns = 0
  32. trees = 0
  33.  
  34. function decs(p)
  35. m = Instance.new("SpawnLocation")
  36. m.Parent = mod
  37. m.Size = Vector3.new(scale/2,char1[5],scale/2)
  38. m.BrickColor = BrickColor.new("Really black")
  39. m.Anchored = true
  40. m.CFrame = p.CFrame * CFrame.new(0,char1[5]/2,0)
  41. spawns = spawns + 1
  42. end
  43.  
  44. function dect(p)
  45. if p.BrickColor.Name == char1[1] then else return end
  46. m = Instance.new("Part")
  47. m.Parent = mod
  48. m.Name = "Tree"
  49. m.Size = Vector3.new(scale/2,char1[5],scale/2)
  50. m.BrickColor = BrickColor.new("Dark green")
  51. m.Anchored = true
  52. m.CFrame = p.CFrame * CFrame.new(0,p.Size.Y/3,0)
  53. msh = Instance.new("SpecialMesh")
  54. msh.Parent = m
  55. msh.MeshId = "ff54d21ba63ff3073f34fda5cd1be3f1"
  56. msh.TextureId = "http://www.roblox.com/asset/?id=37476561"
  57. msh.Scale = Vector3.new(0.1,0.1,0.1)
  58. trees = trees + 1
  59. end
  60.  
  61.  
  62.  
  63. function decor(par, tab, xb, zb)
  64. number = string.sub(par.Name:lower(), 5)
  65. par.Size = Vector3.new(scale,tab[math.random(5,#tab)],scale)
  66. par.BrickColor = BrickColor.new(tab[1])
  67. par.Transparency = tab[3]
  68. par.CanCollide = tab[4]
  69. if tab[1] == "Reddish brown" then
  70. local variation = math.random(1,100)*-0.04
  71. par.CFrame = CFrame.new(xb,par.Size.Y/1.8+variation,zb)
  72. par.Friction = 0.6
  73. end
  74. if tab[1] == "Dark green" then
  75. local variation = math.random(1,100)*-0.004
  76. par.CFrame = CFrame.new(xb,par.Size.Y/1.5+variation,zb)
  77. par.Friction = 0.6
  78. end
  79. if tab[1] == "23" or tab[1] == "Pastel brown" then
  80. par.CFrame = CFrame.new(xb,par.Size.Y/1.5,zb)
  81. if tab[1] == "23" then
  82. par.Friction = 0.9
  83. end
  84. end
  85. end
  86.  
  87. function scan(part, char, type)
  88. if type == "land" then
  89. tri = mod:GetChildren()
  90. for i = 1, #tri do
  91. if math.ceil((tri[i].Position - part.Position).magnitude) <= 15 then
  92. decor(tri[i], char, tri[i].CFrame.X, tri[i].CFrame.Z)
  93. end
  94. end
  95. elseif type == "water" then
  96. tri = mod:GetChildren()
  97. for i = 1, #tri do
  98. if math.ceil((tri[i].Position - part.Position).magnitude) > 0 and math.ceil((tri[i].Position - part.Position).magnitude) < 20 then
  99. if string.sub(tri[i].Name:lower(), 1, 4) == "part" then else return end
  100. decor(tri[i], char, tri[i].CFrame.X, tri[i].CFrame.Z)
  101. end
  102. if math.ceil((tri[i].Position - part.Position).magnitude) > 20 and math.ceil((tri[i].Position - part.Position).magnitude) < 30 then
  103. if string.sub(tri[i].Name:lower(), 1, 4) == "part" then else return end
  104. decor(tri[i], char4, tri[i].CFrame.X, tri[i].CFrame.Z)
  105. end
  106. end
  107. end
  108. end
  109.  
  110. function forestscan(part)
  111. tri = mod:GetChildren()
  112. for i = 1, #tri do
  113. if math.ceil((tri[i].Position - part.Position).magnitude) < 20 then
  114. if string.sub(tri[i].Name:lower(), 1, 4) == "part" then else return end
  115. dect(tri[i])
  116. end
  117. end
  118. end
  119.  
  120. function createtile(number)
  121. p = Instance.new("Part")
  122. p.Parent = mod
  123. p.Name = "Part" ..tostring(number)
  124. if number == n1 or number == n2 then
  125. p.Name = "Clif" ..tostring(number)
  126. decor(p, char2, x, z)
  127. else
  128. if number == n3 then
  129. p.Name = "Wate" ..tostring(number)
  130. decor(p, char3, x, z)
  131. else
  132. decor(p, char1, x, z)
  133. end
  134. end
  135. p.BottomSurface = "Smooth"
  136. p.TopSurface = "Smooth"
  137. p.Anchored = true
  138. if x >= scale*25 then
  139. x = 0
  140. z = z + scale
  141. elseif x < scale*25 then
  142. x = x + scale
  143. end
  144. end
  145.  
  146. for i = 1, 208 do
  147. wait()
  148. createtile(i)
  149. end
  150. t = mod:GetChildren()
  151. for i = 1, #t do
  152. if string.sub(t[i].Name:lower(), 1, 4) == "clif" then
  153. scan(t[i], char2, "land")
  154. end
  155. if string.sub(t[i].Name:lower(), 1, 4) == "wate" then
  156. scan(t[i], char3, "water")
  157. end
  158. if string.sub(t[i].Name:lower(), 1, 4) == "part" then
  159. local lol = math.random(1,25)
  160. if spawns == 0 and lol == 10 then
  161. decs(t[i])
  162. end
  163. local lol2 = math.random(1,25)
  164. if trees == 0 and lol2 == 20 then
  165. dect(t[i])
  166. forestscan(t[i])
  167. end
  168. end
  169. end
Add Comment
Please, Sign In to add comment