Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- WARNING: Heads up! This script has not been verified by ScriptBlox. Use at your own risk!
- ]]
- local Players = game:GetService('Players')
- local CoreGui = game:GetService('StarterGui')
- local ReplicatedStorage = game:GetService('ReplicatedStorage')
- local ContextActionService = game:GetService('ContextActionService')
- local VirtualInputManager = game:GetService('VirtualInputManager')
- local LocalPlayer = Players.LocalPlayer
- local Enabled = false
- local Rod = false
- local Casted = false
- local Progress = false
- local Finished = false
- local Keybind = Enum.KeyCode.F
- function ShowNotification(String)
- CoreGui:SetCore('SendNotification', {
- Title = 'Notification',
- Text = String,
- Duration = 1
- })
- end
- function ToggleFarm(Name, State, Input)
- if State == Enum.UserInputState.Begin then
- Enabled = not Enabled
- if not Enabled then
- Finished = false
- Progress = false
- if Rod then
- Rod.events.reset:FireServer()
- end
- end
- ShowNotification(`Status: {Enabled}`)
- end
- end
- LocalPlayer.Character.ChildAdded:Connect(function(Child)
- if Child:IsA('Tool') and Child.Name:lower():find('rod') then
- Rod = Child
- end
- end)
- LocalPlayer.Character.ChildRemoved:Connect(function(Child)
- if Child == Rod then
- Enabled = false
- Finished = false
- Progress = false
- Rod = nil
- end
- end)
- LocalPlayer.PlayerGui.DescendantAdded:Connect(function(Descendant)
- if Descendant.Name == 'button' and Descendant.Parent.Name == 'safezone' then
- task.wait(0.1)
- local ButtonPosition, ButtonSize = Descendant.AbsolutePosition, Descendant.AbsoluteSize
- VirtualInputManager:SendMouseButtonEvent(ButtonPosition.X + (ButtonSize.X / 2), ButtonPosition.Y + (ButtonSize.Y / 2), Enum.UserInputType.MouseButton1.Value, true, LocalPlayer.PlayerGui, 1)
- VirtualInputManager:SendMouseButtonEvent(ButtonPosition.X + (ButtonSize.X / 2), ButtonPosition.Y + (ButtonSize.Y / 2), Enum.UserInputType.MouseButton1.Value, false, LocalPlayer.PlayerGui, 1)
- elseif Descendant.Name == 'playerbar' and Descendant.Parent.Name == 'bar' then
- Finished = true
- task.wait(1.5)
- print('spamming now!')
- while Finished do
- ReplicatedStorage.events.reelfinished:FireServer(100, true)
- task.wait(0.3)
- end
- end
- end)
- LocalPlayer.PlayerGui.DescendantRemoving:Connect(function(Descendant)
- if Descendant.Name == 'reel' then
- Finished = false
- Progress = false
- workspace.world.npcs['Marc Merchant'].merchant.sellall:InvokeServer()
- end
- end)
- coroutine.wrap(function()
- while true do
- if Enabled and not Progress then
- if Rod then
- Progress = true
- task.wait(0.5)
- Rod.events.reset:FireServer()
- Rod.events.cast:FireServer(100.5)
- end
- end
- task.wait()
- end
- end)()
- local NewRod = LocalPlayer.Character:FindFirstChildWhichIsA('Tool')
- if NewRod and NewRod.Name:lower():find('rod') then
- Rod = NewRod
- end
- ContextActionService:BindAction('ToggleFarm', ToggleFarm, false, Keybind)
- ShowNotification(`Press '{Keybind.Name}' to enable/disable`)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement