skinkillaz

dragon sim

Sep 26th, 2018
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. --[[
  2. -----------------------------
  3. Default Controls:
  4.  
  5. f3 to toggle autofarm
  6.  
  7. -----------------------------
  8. Settings
  9. --]]
  10. Key1 = "F3" --Default is f3
  11.  
  12. Key2 = "F4" --Default is f4
  13.  
  14. Interval = 0 --The amount of time the script will wait
  15.  
  16. NonUIS = true -- set to true if you are using Non-UIS
  17.  
  18. if NonUIS == true then
  19. _G.on = 1 --if you are using non-uis, set this to 0 to turn off mob farm
  20. _G.on2 = 1 --if you are using non-uis, set this to 0 to turn off money farm
  21. end
  22. --[[
  23.  
  24. You can not use certain special characters so I would keep it to the function keys and normal keys
  25.  
  26. E.g. F1, F2, F3, J, K, L, 1, 2, 3, LeftAlt, Space
  27.  
  28. -----------------------------
  29. Game:
  30. https://www.roblox.com/games/2324069335/Dragon-Simulator
  31. -----------------------------
  32. Description:
  33. This will autofarm all fruits giving you coins and gems galore
  34. -----------------------------
  35. Credit:
  36. Original: @Verm brianops16
  37. -----------------------------
  38. --]]
  39.  
  40. plr = game:GetService('Players').LocalPlayer
  41.  
  42. function codeW()
  43. for i,v in pairs(game.Workspace.Foods:GetChildren()) do
  44. if _G.on == 1 then
  45. for a,b in pairs(v:GetChildren()) do
  46. if b ~= nil and _G.on == 1 then
  47. local weapon = game.Workspace[plr.Name]:FindFirstChildOfClass("Tool")
  48. if weapon == nil and _G.on == 1 then
  49. codeB()
  50. else
  51. wait()
  52. local A_1 = "DamageOnServer"
  53. local A_2 = b.Position
  54. local Event = game:GetService("Workspace")[plr.Name][weapon.Name].ServerRemote
  55. Event:FireServer(A_1, A_2)
  56. end
  57. end
  58. end
  59. end
  60. end
  61. end
  62.  
  63. function codeB()
  64. for i,v in pairs(game.Workspace.Foods:GetChildren()) do
  65. if _G.on == 1 then
  66. for a,b in pairs(v:GetChildren()) do
  67. if b ~= nil and _G.on == 1 then
  68. local weapon = plr.Backpack:FindFirstChildOfClass("Tool")
  69. if weapon == nil and _G.on == 1 then
  70. codeW()
  71. else
  72. wait()
  73. local A_1 = "DamageOnServer"
  74. local A_2 = b.Position
  75. local Event = game:GetService("Players")[plr.Name].Backpack[weapon.Name].ServerRemote
  76. Event:FireServer(A_1, A_2)
  77. end
  78. end
  79. end
  80. end
  81. end
  82. end
  83. function code2()
  84. -- Script goes here
  85. end
  86.  
  87. ----
  88.  
  89. if NonUIS == false then
  90. local UIS = game:GetService("UserInputService")
  91. UIS.InputBegan:connect(function(Input)
  92. local KeyCode = Input.KeyCode
  93. if KeyCode == Enum.KeyCode[Key1] then
  94. if _G.on == 1 then
  95. _G.on = 0
  96. else
  97. _G.on = 1
  98. wait(Interval)
  99. while _G.on == 1 do
  100. wait(Interval)
  101. local good,bad = pcall(codeW)
  102. if good and _G.on == 1 then
  103. codeW()
  104. else
  105. local good,bad = pcall(codeB)
  106. if good and _G.on == 1 then
  107.  
  108. codeB()
  109. else
  110. wait(Interval)
  111. end
  112. end
  113. end
  114. end
  115. elseif KeyCode == Enum.KeyCode[Key2] then
  116. if _G.on2 == 1 then
  117. _G.on2 = 0
  118. else
  119. _G.on2 = 1
  120. wait(Interval)
  121. while _G.on2 == 1 do
  122. wait(Interval)
  123. local good,bad = pcall(code2)
  124. if good and _G.on2 == 1 then
  125. code2()
  126. else
  127. wait(Interval)
  128. end
  129. end
  130. end
  131. end
  132. end)
  133. else
  134. while _G.on == 1 do
  135. wait(Interval)
  136. if _G.on == 1 then
  137. codeW()
  138. codeB()
  139. else
  140. wait(Interval)
  141. end
  142. end
  143. end
  144. --Description and controls at the top
Add Comment
Please, Sign In to add comment