kaualima12

Dupa itens e money

Aug 26th, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.90 KB | None | 0 0
  1.  
  2.  
  3. -- Objects
  4.  
  5. local ScreenGui = Instance.new("ScreenGui")
  6. local MainFrame = Instance.new("Frame")
  7. local SaveSlot = Instance.new("TextButton")
  8. local DMoney = Instance.new("TextButton")
  9. local Store = Instance.new("TextButton")
  10. local Restore = Instance.new("TextButton")
  11. local DropAxes = Instance.new("TextButton")
  12. local Load = Instance.new("TextButton")
  13. local CountAxes = Instance.new("TextButton")
  14. local Slot = Instance.new("TextBox")
  15.  
  16. -- Properties
  17.  
  18. ScreenGui.Parent = game.CoreGui
  19. ScreenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  20.  
  21. MainFrame.Name = "LT2DupeGui"
  22. MainFrame.Parent = ScreenGui
  23. MainFrame.BackgroundColor3 = Color3.new(0.282353, 0.278431, 0.278431)
  24. MainFrame.BorderColor3 = Color3.new(0.588235, 0.588235, 0.588235)
  25. MainFrame.BorderSizePixel = 3
  26. MainFrame.Position = UDim2.new(0.111687116, 0, 0.167118713, 0)
  27. MainFrame.Size = UDim2.new(0, 230, 0, 258)
  28. MainFrame.Active = true
  29. MainFrame.Draggable = true
  30.  
  31. SaveSlot.Name = "SaveSlot"
  32. SaveSlot.Parent = MainFrame
  33. SaveSlot.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  34. SaveSlot.BorderSizePixel = 2
  35. SaveSlot.Position = UDim2.new(0.040079806, 0, 0.302941561, 0)
  36. SaveSlot.Size = UDim2.new(0, 95, 0, 40)
  37. SaveSlot.Font = Enum.Font.SourceSans
  38. SaveSlot.Text = "Save Slot"
  39. SaveSlot.TextColor3 = Color3.new(0, 0, 0)
  40. SaveSlot.TextSize = 14
  41.  
  42. DMoney.Name = "DMoney"
  43. DMoney.Parent = MainFrame
  44. DMoney.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  45. DMoney.BorderSizePixel = 2
  46. DMoney.Position = UDim2.new(0.0410686359, 0, 0.774269283, 0)
  47. DMoney.Size = UDim2.new(0, 95, 0, 40)
  48. DMoney.Font = Enum.Font.SourceSans
  49. DMoney.Text = "Dupe Money"
  50. DMoney.TextColor3 = Color3.new(0, 0, 0)
  51. DMoney.TextSize = 14
  52.  
  53. Store.Name = "Store"
  54. Store.Parent = MainFrame
  55. Store.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  56. Store.BorderSizePixel = 2
  57. Store.Position = UDim2.new(0.514908552, 0, 0.299316287, 0)
  58. Store.Size = UDim2.new(0, 95, 0, 40)
  59. Store.Font = Enum.Font.SourceSans
  60. Store.Text = "Store Axe"
  61. Store.TextColor3 = Color3.new(0, 0, 0)
  62. Store.TextSize = 14
  63.  
  64. Restore.Name = "Restore"
  65. Restore.Parent = MainFrame
  66. Restore.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  67. Restore.BorderSizePixel = 2
  68. Restore.Position = UDim2.new(0.51270771, 0, 0.528562546, 0)
  69. Restore.Size = UDim2.new(0, 95, 0, 40)
  70. Restore.Font = Enum.Font.SourceSans
  71. Restore.Text = "Restore Axe"
  72. Restore.TextColor3 = Color3.new(0, 0, 0)
  73. Restore.TextSize = 14
  74.  
  75. DropAxes.Name = "Drop Axes"
  76. DropAxes.Parent = MainFrame
  77. DropAxes.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  78. DropAxes.BorderSizePixel = 2
  79. DropAxes.Position = UDim2.new(0.514981687, 0, 0.774269283, 0)
  80. DropAxes.Size = UDim2.new(0, 95, 0, 40)
  81. DropAxes.Font = Enum.Font.SourceSans
  82. DropAxes.Text = "Drop Axes"
  83. DropAxes.TextColor3 = Color3.new(0, 0, 0)
  84. DropAxes.TextSize = 14
  85.  
  86. Load.Name = "Load"
  87. Load.Parent = MainFrame
  88. Load.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  89. Load.BorderSizePixel = 2
  90. Load.Position = UDim2.new(0.0410686135, 0, 0.530083239, 0)
  91. Load.Size = UDim2.new(0, 95, 0, 40)
  92. Load.Font = Enum.Font.SourceSans
  93. Load.Text = "Load Slot"
  94. Load.TextColor3 = Color3.new(0, 0, 0)
  95. Load.TextSize = 14
  96.  
  97. CountAxes.Name = "Count Axes"
  98. CountAxes.Parent = MainFrame
  99. CountAxes.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  100. CountAxes.BorderSizePixel = 2
  101. CountAxes.Position = UDim2.new(0.510633886, 0, 0.0688429475, 0)
  102. CountAxes.Size = UDim2.new(0, 95, 0, 40)
  103. CountAxes.Font = Enum.Font.SourceSans
  104. CountAxes.Text = "Count Axes"
  105. CountAxes.TextColor3 = Color3.new(0, 0, 0)
  106. CountAxes.TextSize = 14
  107.  
  108. Slot.Name = "Slot"
  109. Slot.Parent = MainFrame
  110. Slot.BackgroundColor3 = Color3.new(0.411765, 0.411765, 0.411765)
  111. Slot.BorderSizePixel = 2
  112. Slot.Position = UDim2.new(0.0410686322, 0, 0.0697674453, 0)
  113. Slot.Size = UDim2.new(0, 94, 0, 39)
  114. Slot.Font = Enum.Font.SourceSans
  115. Slot.Text = "Slot Number"
  116. Slot.TextColor3 = Color3.new(0, 0, 0)
  117. Slot.TextSize = 14
  118.  
  119. --Locals
  120. local MoneyCooldown = false
  121. local CurrentSlot = game.Players.LocalPlayer:WaitForChild("CurrentSaveSlot").Value
  122. local ScriptLoadOrSave = false
  123. local CurrentlySavingOrLoading = game.Players.LocalPlayer:WaitForChild("CurrentlySavingOrLoading")
  124.  
  125. --Functions
  126. local function CheckIfSlotAvailable(Slot)
  127. for a,b in pairs(game.ReplicatedStorage.LoadSaveRequests.GetMetaData:InvokeServer(game.Players.LocalPlayer)) do
  128. if a == Slot then
  129. for c,d in pairs(b) do
  130. if c == "NumSaves" and d ~= 0 then
  131. return true
  132. else
  133. return false
  134. end
  135. end
  136. end
  137. end
  138. end
  139.  
  140. local function CheckSlotNumber() --Checks if the slot number is right
  141. if Slot.Text == "1" or Slot.Text == "2" or Slot.Text == "3" or Slot.Text == "4" or Slot.Text == "5" or Slot.Text == "6" then
  142. local SlotNumber = tonumber(Slot.Text)
  143. return SlotNumber
  144. else return false
  145. end
  146. end
  147.  
  148. local function SendNotification(Title,Text,Duration) -- Sends Notification in the bottom right of the screen
  149. game.StarterGui:SetCore("SendNotification", {
  150. Title = Title;
  151. Text = Text;
  152. Icon = nil;
  153. Duration = Duration
  154. })
  155. end
  156.  
  157. SaveSlot.MouseButton1Down:connect(function() --Saves the slot that you want
  158. local CheckSlot = CheckSlotNumber()
  159. if CheckSlot ~= false then
  160. if CurrentSlot ~= -1 then
  161. ScriptLoadOrSave = true
  162. local SaveSlot = game.ReplicatedStorage.LoadSaveRequests.RequestSave:InvokeServer(CheckSlot)
  163. if SaveSlot == true then
  164. SendNotification("Save Notification", "Saved your Slot", 2)
  165. wait(.5)
  166. ScriptLoadOrSave = false
  167. elseif SaveSlot == false then
  168. SendNotification("Already Saving", "Saving/Loading is currently in Progress", 1)
  169. wait(.5)
  170. ScriptLoadOrSave = false
  171. end
  172. else
  173. SendNotification("Error", "Load Your Slot First before saving", 1)
  174. end
  175. else
  176. SendNotification("Incorrect Slot", "Enter a number in the upper field", 1)
  177. end
  178. end)
  179.  
  180. Load.MouseButton1Down:connect(function() --Loads the slot you want
  181. ScriptLoadOrSave = true
  182. local CheckSlot = CheckSlotNumber()
  183. if CheckSlot ~= false then
  184. if CheckIfSlotAvailable(CheckSlot) == true then
  185. local LoadSlot = game.ReplicatedStorage.LoadSaveRequests.RequestLoad:InvokeServer(CheckSlot)
  186. if LoadSlot == false then
  187. SendNotification("Cooldown Notification", "You aren't abled to load now", 1)
  188. end
  189. if LoadSlot == true then
  190. SendNotification("Reload Notification", "Loaded Your Slot", 2)
  191. CurrentSlot = CheckSlot
  192. end
  193. else
  194. SendNotification("Slot not Available", "This Slot is not Available, please choose another slot", 2)
  195. end
  196. else
  197. SendNotification("Incorrect Slot", "Enter a Valid number in the upper field", 1)
  198. end
  199. ScriptLoadOrSave = false
  200. end)
  201.  
  202. Store.MouseButton1Down:connect(function() --Stores the Axes somewhere so you can restore them later
  203. Amount = 0
  204. for a,b in pairs(game.Players.LocalPlayer.Backpack:GetChildren())do
  205. if b.Name ~= "BlueprintTool" and b.Name == "Tool" then
  206. b.Parent = game.Players.LocalPlayer
  207. Amount = Amount + 1
  208. end
  209. end
  210. SendNotification("Store Notification", "Stored "..Amount.." Axes, you can restore them later", 2)
  211. end)
  212.  
  213. Restore.MouseButton1Down:connect(function() --Restores the axes that you stored with the Store function
  214. Amount = 0
  215. for a,b in pairs(game.Players.LocalPlayer:GetChildren()) do
  216. if b.Name ~= "BlueprintTool" and b.Name == "Tool" then
  217. b.Parent = game.Players.LocalPlayer.Backpack
  218. Amount = Amount + 1
  219. end
  220. end
  221. SendNotification("Restore Notification", "Restored "..Amount.." Axes that you Stored", 2)
  222. end)
  223.  
  224. CountAxes.MouseButton1Down:connect(function() --Counts Axes in your Backpack (Equiped Axes dont Count)
  225. Amount = 0
  226. for a,b in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
  227. if b.Name ~= "BlueprintTool" and b.Name == "Tool" then
  228. Amount = Amount + 1
  229. end
  230. end
  231. SendNotification("Axe Amount", "You have "..Amount.." Axes in your Backpack",2)
  232. end)
  233.  
  234. DropAxes.MouseButton1Down:connect(function() --Drops all your Axes
  235. Amount = 0
  236. for a,b in pairs(game.Players.LocalPlayer.Backpack:GetChildren()) do
  237. if b.Name ~= "BlueprintTool" and b.Name == "Tool" then
  238. game.ReplicatedStorage.Interaction.ClientInteracted:FireServer(b, "Drop tool", game.Players.LocalPlayer.Character.Head.CFrame)
  239. Amount = Amount + 1
  240. end
  241. end
  242. SendNotification("Axe Dropped", "Dropped "..Amount.." Axes from your Backpack",5)
  243. end)
  244.  
  245. DMoney.MouseButton1Down:connect(function() --Sends the money and will come back after around 2 mins
  246. if MoneyCooldown == true then
  247. SendNotification("Cooldown Notification", "Wait for your Money to come back",2)
  248. return
  249. elseif MoneyCooldown == false then
  250. MoneyCooldown = true
  251. SendNotification("Money Sent", "Wait about 2 minutes for your Money to come back", 5)
  252. game.ReplicatedStorage.Transactions.ClientToServer.Donate:InvokeServer(game.Players.LocalPlayer, game.Players.LocalPlayer.leaderstats.Money.Value, 1)
  253. SendNotification("Money Received", "You received your money that you have sent earlier", 5)
  254. MoneyCooldown = false
  255. end
  256. end)
  257.  
  258. --Anti Overwrite Slot (Sub-Function)
  259. while wait(.15) do
  260. if CurrentlySavingOrLoading.Value == true and ScriptLoadOrSave == false then
  261. repeat
  262. wait(1)
  263. until CurrentlySavingOrLoading.Value == false
  264. wait(1)
  265. CurrentSlot = game.Players.LocalPlayer.CurrentSaveSlot.Value
  266. print(CurrentSlot)
  267. end
  268. end
Add Comment
Please, Sign In to add comment