Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.farm = true --change to false and execute to stop script
- local localplayer = game:service"Players".LocalPlayer
- local r = game:service("RunService").RenderStepped
- local snowballController = game.ReplicatedStorage.ThisGame.Calls.snowballController
- local snowballControllerFunc = game.ReplicatedStorage.ThisGame.Calls.snowballControllerFunc
- local collectSnow = game.ReplicatedStorage.ThisGame.Calls.collectSnow
- local base
- local snowballs
- local currentsnowballs, maxsnowballs
- function getbase()
- local time = tick()
- repeat
- for i,v in next, game:service("Workspace").snowmanBases:GetChildren() do
- if v:IsA("Part") and v.Name == "LandPlot" and v.player and tostring(v.player.Value) == localplayer.Name then
- base = v
- end
- end
- r:wait()
- until base ~= nil or tick()-time > 5
- if base == nil then
- -- localplayer:Kick"base not found, aborting."
- print("base wasn't found")
- return
- end
- end
- function checksnowballs()
- local time = tick()
- repeat
- snowballs = localplayer.PlayerGui.Main.leftMenu.snowballs.Frame.textArea.TextLabel
- r:wait()
- until base ~= nil or tick()-time > 5
- if snowballs == nil or not snowballs.Text:find("/") then
- localplayer:Kick"snowball amount not found, aborting."
- return
- end
- function parsesnowballs()
- current = snowballs.Text:match("(%d+)/%d+")
- max = snowballs.Text:match("%d+/(%d+)")
- return tonumber(current), tonumber(max)
- end
- return parsesnowballs()
- end
- function snowballloop()
- while r:wait() and _G.farm do
- a, currentsnowballs, maxsnowballs = pcall(checksnowballs)
- end
- end
- function farmloop()
- while r:wait() and _G.farm do
- snowballController:FireServer("startRoll")
- r:wait(0.1)
- collectSnow:FireServer()
- r:wait(0.1)
- snowballControllerFunc:InvokeServer("stopRoll")
- r:wait(0.1)
- snowballController:FireServer("addToSnowman")
- end
- end
- pcall(getbase)
- pcall(spawn, snowballloop)
- repeat r:wait() until currentsnowballs ~= nil and maxsnowballs ~= nil
- pcall(spawn, farmloop)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement