Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- -----------------------------
- Default Controls:
- f3 to toggle autofarm
- -----------------------------
- Settings
- --]]
- Key1 = "F3" --Default is f3
- Key2 = "F4" --Default is f4
- Interval = 0 --The amount of time the script will wait
- NonUIS = true -- set to true if you are using Non-UIS
- if NonUIS == true then
- _G.on = 1 --if you are using non-uis, set this to 0 to turn off mob farm
- _G.on2 = 1 --if you are using non-uis, set this to 0 to turn off money farm
- end
- --[[
- You can not use certain special characters so I would keep it to the function keys and normal keys
- E.g. F1, F2, F3, J, K, L, 1, 2, 3, LeftAlt, Space
- -----------------------------
- Game:
- https://www.roblox.com/games/2324069335/Dragon-Simulator
- -----------------------------
- Description:
- This will autofarm all fruits giving you coins and gems galore
- -----------------------------
- Credit:
- Original: @Verm brianops16
- -----------------------------
- --]]
- plr = game:GetService('Players').LocalPlayer
- function codeW()
- for i,v in pairs(game.Workspace.Foods:GetChildren()) do
- if _G.on == 1 then
- for a,b in pairs(v:GetChildren()) do
- if b ~= nil and _G.on == 1 then
- local weapon = game.Workspace[plr.Name]:FindFirstChildOfClass("Tool")
- if weapon == nil and _G.on == 1 then
- codeB()
- else
- wait()
- local A_1 = "DamageOnServer"
- local A_2 = b.Position
- local Event = game:GetService("Workspace")[plr.Name][weapon.Name].ServerRemote
- Event:FireServer(A_1, A_2)
- end
- end
- end
- end
- end
- end
- function codeB()
- for i,v in pairs(game.Workspace.Foods:GetChildren()) do
- if _G.on == 1 then
- for a,b in pairs(v:GetChildren()) do
- if b ~= nil and _G.on == 1 then
- local weapon = plr.Backpack:FindFirstChildOfClass("Tool")
- if weapon == nil and _G.on == 1 then
- codeW()
- else
- wait()
- local A_1 = "DamageOnServer"
- local A_2 = b.Position
- local Event = game:GetService("Players")[plr.Name].Backpack[weapon.Name].ServerRemote
- Event:FireServer(A_1, A_2)
- end
- end
- end
- end
- end
- end
- function code2()
- -- Script goes here
- end
- ----
- if NonUIS == false then
- local UIS = game:GetService("UserInputService")
- UIS.InputBegan:connect(function(Input)
- local KeyCode = Input.KeyCode
- if KeyCode == Enum.KeyCode[Key1] then
- if _G.on == 1 then
- _G.on = 0
- else
- _G.on = 1
- wait(Interval)
- while _G.on == 1 do
- wait(Interval)
- local good,bad = pcall(codeW)
- if good and _G.on == 1 then
- codeW()
- else
- local good,bad = pcall(codeB)
- if good and _G.on == 1 then
- codeB()
- else
- wait(Interval)
- end
- end
- end
- end
- elseif KeyCode == Enum.KeyCode[Key2] then
- if _G.on2 == 1 then
- _G.on2 = 0
- else
- _G.on2 = 1
- wait(Interval)
- while _G.on2 == 1 do
- wait(Interval)
- local good,bad = pcall(code2)
- if good and _G.on2 == 1 then
- code2()
- else
- wait(Interval)
- end
- end
- end
- end
- end)
- else
- while _G.on == 1 do
- wait(Interval)
- if _G.on == 1 then
- codeW()
- codeB()
- else
- wait(Interval)
- end
- end
- end
- --Description and controls at the top
Add Comment
Please, Sign In to add comment