Upscalefanatic3

Apocalypse Rising Script (GUI)

Jan 24th, 2018
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.05 KB | None | 0 0
  1. local spawner = Instance.new("ScreenGui")
  2. local Main = Instance.new("Frame")
  3. local ItemFrame = Instance.new("ScrollingFrame")
  4. local ItemSearch = Instance.new("TextBox")
  5. local SpawnButton = Instance.new("TextButton")
  6. local Title = Instance.new("TextLabel")
  7.  
  8.  
  9. spawner.Name = "spawner"
  10. spawner.Parent = game.CoreGui
  11.  
  12. Main.Name = "Main"
  13. Main.Parent = spawner
  14. Main.BackgroundColor3 = Color3.new(0.701961, 0.701961, 0.701961)
  15. Main.BorderSizePixel = 0
  16. Main.Position = UDim2.new(0, 667, 0, 228)
  17. Main.Size = UDim2.new(0, 266, 0, 244)
  18. Main.Active = true
  19. Main.Draggable = true
  20.  
  21. ItemFrame.Name = "ItemFrame"
  22. ItemFrame.Parent = Main
  23. ItemFrame.BackgroundColor3 = Color3.new(0.317647, 0.317647, 0.317647)
  24. ItemFrame.BorderSizePixel = 0
  25. ItemFrame.Position = UDim2.new(0, 56, 0, 76)
  26. ItemFrame.Size = UDim2.new(0, 155, 0, 92)
  27. ItemFrame.BottomImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  28. ItemFrame.CanvasSize = UDim2.new(0, 0, 0, 0)
  29. ItemFrame.TopImage = "rbxasset://textures/ui/Scroll/scroll-middle.png"
  30.  
  31. ItemSearch.Name = "ItemSearch"
  32. ItemSearch.Parent = Main
  33. ItemSearch.BackgroundColor3 = Color3.new(0.533333, 0.533333, 0.533333)
  34. ItemSearch.BorderSizePixel = 0
  35. ItemSearch.Position = UDim2.new(0, 56, 0, 53)
  36. ItemSearch.Size = UDim2.new(0, 155, 0, 25)
  37. ItemSearch.Font = Enum.Font.SourceSansBold
  38. ItemSearch.FontSize = Enum.FontSize.Size14
  39. ItemSearch.Text = "Search for an item!"
  40. ItemSearch.TextColor3 = Color3.new(1, 1, 1)
  41. ItemSearch.TextScaled = true
  42. ItemSearch.TextSize = 14
  43. ItemSearch.TextWrapped = true
  44.  
  45. SpawnButton.Name = "SpawnButton"
  46. SpawnButton.Parent = Main
  47. SpawnButton.BackgroundColor3 = Color3.new(0.027451, 1, 0.482353)
  48. SpawnButton.BorderSizePixel = 0
  49. SpawnButton.Position = UDim2.new(0, 34, 0, 186)
  50. SpawnButton.Size = UDim2.new(0, 199, 0, 35)
  51. SpawnButton.ZIndex = 2
  52. SpawnButton.AutoButtonColor = false
  53. SpawnButton.Font = Enum.Font.ArialBold
  54. SpawnButton.FontSize = Enum.FontSize.Size14
  55. SpawnButton.Text = "SPAWN"
  56. SpawnButton.TextColor3 = Color3.new(1, 1, 1)
  57. SpawnButton.TextScaled = true
  58. SpawnButton.TextSize = 14
  59. SpawnButton.TextWrapped = true
  60.  
  61. Title.Name = "Title"
  62. Title.Parent = Main
  63. Title.BackgroundColor3 = Color3.new(1, 1, 1)
  64. Title.BackgroundTransparency = 1
  65. Title.BorderSizePixel = 0
  66. Title.Size = UDim2.new(0, 266, 0, 30)
  67. Title.Font = Enum.Font.SourceSansBold
  68. Title.FontSize = Enum.FontSize.Size14
  69. Title.Text = " APOC SPAWN GUI"
  70. Title.TextColor3 = Color3.new(1, 1, 1)
  71. Title.TextScaled = true
  72. Title.TextSize = 14
  73. Title.TextWrapped = true
  74.  
  75. local backgroundObjects = Instance.new('Folder', spawner.Main)
  76. backgroundObjects.Name = 'BackgroundObjects'
  77.  
  78. local SpawnButton = Instance.new("TextButton", backgroundObjects)
  79. SpawnButton.Name = "SpawnButton"
  80. SpawnButton.Parent = game.CoreGui.spawner.Main.BackgroundObjects
  81. SpawnButton.BackgroundColor3 = Color3.new(0.0196078, 0.729412, 0.34902)
  82. SpawnButton.BorderSizePixel = 0
  83. SpawnButton.Position = UDim2.new(0, 34, 0, 193)
  84. SpawnButton.Size = UDim2.new(0, 199, 0, 35)
  85. SpawnButton.AutoButtonColor = false
  86. SpawnButton.Font = Enum.Font.SourceSans
  87. SpawnButton.FontSize = Enum.FontSize.Size14
  88. SpawnButton.Text = ""
  89. SpawnButton.TextSize = 14
  90.  
  91. local gui = spawner.Main
  92. local box = gui:WaitForChild('ItemSearch')
  93. local items = gui:WaitForChild('ItemFrame')
  94. local path = game.Lighting.LootDrops
  95. local btn = gui:WaitForChild('SpawnButton')
  96. local pos = gui:WaitForChild('BackgroundObjects').SpawnButton.Position
  97. local sPos = btn.Position
  98. local client = game.Players.LocalPlayer
  99.  
  100.  
  101. local function search(text)
  102. local items = {}
  103. for i, v in next, path:GetChildren() do
  104. if text:upper() == v.Name:sub(1, string.len(text)):upper() then
  105. table.insert(items, v.Name)
  106. end
  107. end
  108. return items
  109. end
  110.  
  111. local function bind(thing, f)
  112. thing.MouseButton1Click:connect(function()
  113. f()
  114. end)
  115. end
  116.  
  117. box.Changed:connect(function()
  118. local list = search(box.Text)
  119. if box.Text:gsub("", "") == "" then
  120. items.CanvasSize = UDim2.new(0, 0, 0, 0)
  121. items:ClearAllChildren()
  122. return
  123. end
  124. items.CanvasSize = UDim2.new(0, 0, 0, 0)
  125. items:ClearAllChildren()
  126. for i, v in next, list do
  127. local yPos = ((20 * i) - 20)
  128. local s = Instance.new('TextButton', items)
  129. s.BorderSizePixel = 0
  130. s.Font = Enum.Font.ArialBold
  131. s.TextScaled = true
  132. s.Text = v
  133. s.Name = v
  134. s.BackgroundColor3 = Color3.fromRGB(211, 211, 211)
  135. s.TextColor3 = Color3.new(0, 0, 0)
  136. s.Size = UDim2.new(0, 155, 0, 20)
  137. s.Position = UDim2.new(0, 0, 0, yPos)
  138. bind(s, function()
  139. box.Text = s.Text
  140. items:ClearAllChildren()
  141. items.CanvasSize = UDim2.new(0, 0, 0, 0)
  142. end)
  143. end
  144. items.CanvasSize = UDim2.new(0, 0, 0, (20 * #list))
  145. end)
  146.  
  147. btn.MouseButton1Click:connect(function()
  148. local item = path:FindFirstChild(box.Text)
  149. btn.Position = pos
  150. wait(1/10)
  151. btn.Position = sPos
  152. if item then
  153. game.Workspace.Remote.PlaceMaterial:FireServer(item, client.Character.Torso.Position - item.PrimaryPart.Position + Vector3.new(math.random(1,10),1,math.random(1,10)))
  154. else
  155. client.PlayerGui.MessageSystem.NewMessage.Color.Value = "Blue"
  156. client.PlayerGui.MessageSystem.NewMessage.Value = "Could not find item."
  157. end
  158. end)
Add Comment
Please, Sign In to add comment