Advertisement
Scelt

Sugar Simulator GUI

Feb 8th, 2019
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 KB | None | 0 0
  1. -- Created by Cow
  2. -- Created: 2/5/19
  3.  
  4. -- Game: https://www.roblox.com/games/2606447854
  5. local storage = game:GetService("ReplicatedStorage")
  6.  
  7. local player = game:GetService("Players").LocalPlayer
  8.  
  9. local character = player.Character
  10.  
  11. local playerGui = player:FindFirstChild("PlayerGui")
  12.  
  13. local mouse = player:GetMouse()
  14.  
  15. local realm = "Starter"
  16. local autoTp = false
  17. local autoClick = false
  18.  
  19. local teleportLocations = {}
  20. teleportLocations[1] = {"Shop1", 221, 30, -740}
  21. teleportLocations[2] = {"Sell", 515, 29, -134}
  22. teleportLocations[3] = {"Starter", 166, 30, -718}
  23. teleportLocations[4] = {"Candyland", 57, 30, 25}
  24. teleportLocations[5] = {"Beach", 775, 37, -742}
  25. teleportLocations[6] = {"Snowtime", -393, 30, -473}
  26. teleportLocations[7] = {"Forest", 527, 29, -151}
  27.  
  28. local realms = {}
  29. realms[1] = "Starter"
  30. realms[2] = "Candyland"
  31. realms[3] = "Beach"
  32. realms[4] = "Snowtime"
  33. realms[5] = "Forest"
  34.  
  35. local sells = {}
  36. sells["Starter"] = Vector3.new(180, 30, -757)
  37. sells["Candyland"] = Vector3.new(35, 30, 12)
  38. sells["Beach"] = Vector3.new(750, 37, -745)
  39. sells["Snowtime"] = Vector3.new(407, 30, -500)
  40. sells["Forest"] = Vector3.new(515, 29, -134)
  41.  
  42. for i, v in pairs(playerGui:GetChildren()) do
  43. if v.Name == "Cow's_Sugar_Simulator_Gui" then
  44. v:Destroy()
  45. end
  46. end
  47.  
  48. local screenGui = Instance.new("ScreenGui", playerGui)
  49. screenGui.Name = "Cow's_Sugar_Simulator_Gui"
  50.  
  51. function createGui()
  52. local frame = Instance.new("Frame", screenGui)
  53. frame.Size = UDim2.new(0, -150, 0, 0)
  54. frame.Position = UDim2.new(1, -5, 0.4, 0)
  55. frame.BackgroundTransparency = 1
  56.  
  57. local teleportButton = Instance.new("TextButton", frame)
  58. teleportButton.Size = UDim2.new(1, 0, 0, 36)
  59. teleportButton.Position = UDim2.new(0, 0, 0, 0)
  60. teleportButton.Text = "Teleports"
  61. teleportButton.Font = Enum.Font.SourceSansBold
  62. teleportButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  63. teleportButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  64. teleportButton.TextScaled = true
  65.  
  66. local realmButton = Instance.new("TextButton", frame)
  67. realmButton.Size = UDim2.new(1, 0, 0, 36)
  68. realmButton.Position = UDim2.new(0, 0, 0, 41)
  69. realmButton.Text = "Realms"
  70. realmButton.Font = Enum.Font.SourceSansBold
  71. realmButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  72. realmButton.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  73. realmButton.TextScaled = true
  74.  
  75. teleportButton.MouseButton1Click:Connect(function()
  76. if frame:FindFirstChild("realmGui") then
  77. realmButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  78. frame:FindFirstChild("realmGui"):Destroy()
  79. end
  80. if frame:FindFirstChild("teleportGui") then
  81. teleportButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  82. frame:FindFirstChild("teleportGui"):Destroy()
  83. else
  84. teleportButton.TextColor3 = Color3.fromRGB(125, 125, 125)
  85. createTeleportGui(frame)
  86. end
  87. end)
  88.  
  89. realmButton.MouseButton1Click:Connect(function()
  90. if frame:FindFirstChild("teleportGui") then
  91. teleportButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  92. frame:FindFirstChild("teleportGui"):Destroy()
  93. end
  94. if frame:FindFirstChild("realmGui") then
  95. realmButton.TextColor3 = Color3.fromRGB(255, 255, 255)
  96. frame:FindFirstChild("realmGui"):Destroy()
  97. else
  98. realmButton.TextColor3 = Color3.fromRGB(125, 125, 125)
  99. createRealmGui(frame)
  100. end
  101. end)
  102.  
  103. local text = Instance.new("TextLabel", frame)
  104. text.Size = UDim2.new(0.75, 0, 0, 36)
  105. text.Position = UDim2.new(0, 0, 0, 82)
  106. text.Text = "Auto TP"
  107. text.Font = Enum.Font.SourceSansBold
  108. text.TextColor3 = Color3.fromRGB(255, 255, 255)
  109. text.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  110. text.TextScaled = true
  111.  
  112. local status = Instance.new("TextButton", frame)
  113. status.Size = UDim2.new(0.25, -5, 0, 36)
  114. status.Position = UDim2.new(0.75, 5, 0, 82)
  115. status.Text = "Off"
  116. status.Font = Enum.Font.SourceSansBold
  117. status.TextColor3 = Color3.fromRGB(255, 0, 0)
  118. status.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  119. status.TextScaled = true
  120.  
  121. status.MouseButton1Click:Connect(function()
  122. if autoTp then
  123. autoTp = false
  124. status.Text = "Off"
  125. status.TextColor3 = Color3.fromRGB(255, 0, 0)
  126. else
  127. autoTp = true
  128. status.Text = "On"
  129. status.TextColor3 = Color3.fromRGB(0, 255, 0)
  130. autoTeleportFunc()
  131. end
  132. end)
  133.  
  134. local text = Instance.new("TextLabel", frame)
  135. text.Size = UDim2.new(0.75, 0, 0, 36)
  136. text.Position = UDim2.new(0, 0, 0, 123)
  137. text.Text = "Auto Click"
  138. text.Font = Enum.Font.SourceSansBold
  139. text.TextColor3 = Color3.fromRGB(255, 255, 255)
  140. text.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  141. text.TextScaled = true
  142.  
  143. local status = Instance.new("TextButton", frame)
  144. status.Size = UDim2.new(0.25, -5, 0, 36)
  145. status.Position = UDim2.new(0.75, 5, 0, 123)
  146. status.Text = "Off"
  147. status.Font = Enum.Font.SourceSansBold
  148. status.TextColor3 = Color3.fromRGB(255, 0, 0)
  149. status.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  150. status.TextScaled = true
  151.  
  152. status.MouseButton1Click:Connect(function()
  153. if autoClick then
  154. autoClick = false
  155. status.Text = "Off"
  156. status.TextColor3 = Color3.fromRGB(255, 0, 0)
  157. else
  158. autoClick = true
  159. status.Text = "On"
  160. status.TextColor3 = Color3.fromRGB(0, 255, 0)
  161. autoClickFunc()
  162. end
  163. end)
  164. end
  165. createGui()
  166.  
  167. function createTeleportGui(frame)
  168. local frame = Instance.new("Frame", frame)
  169. frame.Name = "teleportGui"
  170. frame.Size = frame.Parent.Size
  171. frame.Position = UDim2.new(0, -5, frame.Parent.Position.X.Scale, 0)
  172. frame.BackgroundTransparency = 1
  173.  
  174. for i, v in pairs(teleportLocations) do
  175. local text = Instance.new("TextButton", frame)
  176. text.Size = UDim2.new(1, 0, 0, 36)
  177. text.Position = UDim2.new(0, 0, 0, 41 * (i - 1))
  178. text.Text = teleportLocations[i][1]
  179. text.Font = Enum.Font.SourceSansBold
  180. text.TextColor3 = Color3.fromRGB(255, 255, 255)
  181. text.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  182. text.TextScaled = true
  183.  
  184. text.MouseButton1Click:Connect(function()
  185. character:MoveTo(Vector3.new(teleportLocations[i][2], teleportLocations[i][3], teleportLocations[i][4]))
  186. end)
  187. end
  188. end
  189.  
  190. function createRealmGui(frame)
  191. local frame = Instance.new("Frame", frame)
  192. frame.Name = "realmGui"
  193. frame.Size = frame.Parent.Size
  194. frame.Position = UDim2.new(0, -5, frame.Parent.Position.X.Scale, 0)
  195. frame.BackgroundTransparency = 1
  196.  
  197. for i, v in pairs(realms) do
  198. local text = Instance.new("TextButton", frame)
  199. text.Size = UDim2.new(1, 0, 0, 36)
  200. text.Position = UDim2.new(0, 0, 0, 41 * (i - 1))
  201. text.Text = realms[i]
  202. text.Font = Enum.Font.SourceSansBold
  203. if realms[i] ~= realm then
  204. text.TextColor3 = Color3.fromRGB(255, 255, 255)
  205. else
  206. text.TextColor3 = Color3.fromRGB(125, 125, 125)
  207. end
  208. text.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
  209. text.TextScaled = true
  210.  
  211. text.MouseButton1Click:Connect(function()
  212. for i, v in pairs(text.Parent:GetChildren()) do
  213. v.TextColor3 = Color3.fromRGB(255, 255, 255)
  214. end
  215. text.TextColor3 = Color3.fromRGB(125, 125, 125)
  216. realm = realms[i]
  217. end)
  218. end
  219. end
  220.  
  221. local canClick = true
  222. function autoClickFunc()
  223. if autoClick and canClick then
  224. canClick = false
  225. game:GetService("ReplicatedStorage").Events.ScreenClick:FireServer()
  226. delay(1, function()
  227. canClick = true
  228. autoClickFunc()
  229. end)
  230. end
  231. end
  232.  
  233. local canTP = true
  234. function autoTeleportFunc()
  235. if autoTp and canTP then
  236. for i, v in pairs(workspace.Realms:FindFirstChild(realm).Candies:GetChildren()) do
  237. if not autoTp then
  238. return
  239. end
  240. canTP = false
  241. character:MoveTo(v.Position)
  242. wait(0.5)
  243. character:MoveTo(sells[realm])
  244. wait(1)
  245. canTP = true
  246. end
  247. if autoTp then
  248. autoTeleportFunc()
  249. end
  250. end
  251. end
  252.  
  253. --Showcased By Scelt#3641
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement