Advertisement
LeviTheOtaku

[REL] Treelands Item Spawner.

Nov 20th, 2017
1,709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.45 KB | None | 0 0
  1. local TreelandsDuplicatorGui = Instance.new("ScreenGui")
  2. local MainFrame = Instance.new("Frame")
  3. local FruitsFrame = Instance.new("ScrollingFrame")
  4.  
  5. TreelandsDuplicatorGui.Name = "TreelandsDuplicatorGui"
  6. TreelandsDuplicatorGui.Parent = game.CoreGui
  7.  
  8. MainFrame.Name = "MainFrame"
  9. MainFrame.Parent = TreelandsDuplicatorGui
  10. MainFrame.Active = true
  11. MainFrame.BackgroundColor3 = Color3.new(0, 0, 0)
  12. MainFrame.BorderSizePixel = 0
  13. MainFrame.Draggable = true
  14. MainFrame.Position = UDim2.new(0.249816313, 0, 0.250611246, 0)
  15. MainFrame.Size = UDim2.new(0.200000003, 0, 0.150000006, 0)
  16.  
  17. FruitsFrame.Name = "FruitsFrame"
  18. FruitsFrame.Parent = MainFrame
  19. FruitsFrame.BackgroundColor3 = Color3.new(1, 1, 1)
  20. FruitsFrame.BackgroundTransparency = 0.69999998807907
  21. FruitsFrame.BorderSizePixel = 0
  22. FruitsFrame.Position = UDim2.new(0.075000003, 0, 0.25, 0)
  23. FruitsFrame.Size = UDim2.new(0.850000024, 0, 0.5, 0)
  24. FruitsFrame.ScrollBarThickness = 0
  25. FruitsFrame.CanvasSize = UDim2.new(0, 0, 100, 0)
  26.  
  27.  
  28. local Fruits = game.Workspace.Fruits
  29. local Status = false
  30. local possibleFruits =
  31. {
  32. "",
  33. "-- FRUITS --",
  34. "",
  35. "Apple",
  36. "Banana",
  37. "Blackberry",
  38. "Blueberry",
  39. "Durian",
  40. "Green Apple",
  41. "Kiwi",
  42. "Large Banana",
  43. "Horned Melon",
  44. "Kumquat",
  45. "Lemon",
  46. "Mango",
  47. "Orange",
  48. "Papaya",
  49. "Peach",
  50. "Pear",
  51. "Pineapple",
  52. "Plum",
  53. "Pomelo",
  54. "Potato",
  55. "Watermelon",
  56. "",
  57. "-- CRYSTALS --",
  58. "",
  59. "Blue Crystal",
  60. "Green Crystal",
  61. "Orange Crystal",
  62. "Purple Crystal",
  63. "Red Crystal",
  64. "",
  65. "-- MOST VALUABLE --",
  66. "",
  67. "Pineapple",   
  68. }
  69.  
  70. nr = 0
  71. currentPos = UDim2.new(0,0,0,0)
  72. for iv,xv in pairs(possibleFruits) do
  73. print(possibleFruits[nr])
  74. nr = nr+1
  75. local FruitButton = Instance.new("TextButton")
  76. FruitButton.Name = "FruitButton"
  77. FruitButton.Parent = FruitsFrame
  78. FruitButton.BackgroundColor3 = Color3.new(0.345098, 0.345098, 0.345098)
  79. FruitButton.BorderColor3 = Color3.new(1, 1, 1)
  80. FruitButton.BorderSizePixel = 0
  81. FruitButton.Size = UDim2.new(1, 0, 0.0025, 0)
  82. FruitButton.Font = Enum.Font.SourceSans
  83. FruitButton.FontSize = Enum.FontSize.Size14
  84. FruitButton.Text = possibleFruits[nr]
  85. FruitButton.TextColor3 = Color3.new(1, 1, 1)
  86. FruitButton.TextScaled = true
  87. FruitButton.Position = currentPos
  88. FruitButton.TextSize = 14
  89. FruitButton.TextWrapped = true
  90. FruitButton.MouseButton1Down:connect(function()
  91. local checkhowmany = 0;
  92. for i,v in pairs(Fruits:GetChildren()) do
  93.     checkhowmany = checkhowmany + 1
  94. end
  95. if checkhowmany == 0 then
  96.     Status = false
  97.     return
  98. else
  99.     Status = true
  100. end
  101. for i,v in pairs(Fruits:GetChildren()) do
  102.     v.Name = FruitButton.Text
  103.     v.Tooltip.Value = FruitButton.Text
  104.     local d = Instance.new("Decal")
  105.     d.Face = "Top"
  106.     d.Texture = "http://www.roblox.com/asset/?id=1135215259"
  107.     local d1 = d:clone()
  108.     local d2 = d:clone()
  109.     local d3 = d:clone()
  110.     local d4 = d:clone()
  111.     local d5 = d:clone()
  112.     local d6 = d:clone()
  113.     local b = v:Clone()
  114.     d1.Parent = b
  115.     d2.Parent = b
  116.     d3.Parent = b
  117.     d4.Parent = b
  118.     d5.Parent = b
  119.     d6.Parent = b
  120.     d1.Face = "Top"
  121.     d2.Face = "Right"
  122.     d3.Face = "Left"
  123.     d4.Face = "Front"
  124.     d5.Face = "Bottom"
  125.     d6.Face = "Back"
  126.     b.Mesh:remove()
  127.     b.Size = Vector3.new(2,2,2)
  128.     b.Parent = Fruits
  129.     b.Transparency = 0.5
  130.     break
  131. end
  132. end)
  133. currentPos = currentPos + UDim2.new(0, 0, 0.0025,0)
  134. end
  135.  
  136. Fruits.ChildAdded:connect(function()
  137.     Status = true
  138. end)
  139. Fruits.ChildRemoved:connect(function()
  140. local checkhowmany = 0;
  141. for i,v in pairs(Fruits:GetChildren()) do
  142.     checkhowmany = checkhowmany + 1
  143. end
  144. if checkhowmany == 0 then
  145.     Status = false
  146. end
  147. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement