Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local main = require(game:GetService("ServerScriptService").Main)
- local msg = require(game:GetService("ServerScriptService").Message)
- while true do
- wait(1)
- local success, err = pcall(function()
- for _,player in pairs(Players:GetPlayers()) do
- local GPStat = main:QueryStat(player,"GoldPoints",0)
- local DIAR = main:QueryStat(player,"DaysInARow",0)
- local Day = main:QueryStat(player,"Day",0)
- if GPStat and DIAR and Day then
- if os.difftime(os.time(),Day) >= (60*60)*0.025 then
- if os.difftime(os.time(),Day) >= (60*60)*0.050 then
- main:SetStat(player, "DaysInARow", 0)
- end
- main:SetStat(player, "Day", os.time())
- main:AddStat(player, "DaysInARow", 1)
- if main:QueryStat(player,"DaysInARow") >= 1 then
- msg:Announce(player,"Awarded 100 Gold Points for your first daily login. Check back tomorrow for 300 Gold Points.")
- main:AddStat(player, "GoldPoints", 100, true)
- elseif main:QueryStat(player,"DaysInARow") >= 2 then
- msg:Announce(player,"Awarded 300 Gold Points for your second daily login. Check back tomorrow for 500 Gold Points.")
- main:AddStat(player, "GoldPoints", 300, true)
- elseif main:QueryStat(player,"DaysInARow") >= 3 then
- msg:Announce(player,"Awarded 500 Gold Points for your third daily login. Check back tomorrow for 700 Gold Points and 100,000 Multiplier.")
- main:AddStat(player, "GoldPoints", 500, true)
- elseif main:QueryStat(player,"DaysInARow") >= 4 then
- msg:Announce(player,"Awarded 700 Gold Points and 100,000 multiplier for your fourth daily login. Check back tomorrow for 1000 Gold Points.")
- main:AddStat(player, "GoldPoints", 700, true)
- main:AddStat(player, "Multiplier", 100000*main:QueryStat(player,"Omega"), true)
- elseif main:QueryStat(player,"DaysInARow") >= 5 then
- msg:Announce(player,"Awarded 1000 Gold Points for your fifth daily login. Check back tomorrow for 5000 Gold Points.")
- main:AddStat(player, "GoldPoints", 1000, true)
- elseif main:QueryStat(player,"DaysInARow") >= 6 then
- msg:Announce(player,"Awarded 5000 Gold Points for your sixth daily login. Check back tomorrow for 7000 Gold Points and 75 Omega Multiplier.")
- main:AddStat(player, "GoldPoints", 5000, true)
- elseif main:QueryStat(player,"DaysInARow") >= 7 then
- msg:Announce(player,"Awarded 7000 Gold Points and 75 omega for your seventh daily login. Check back tomorrow for 100 Gold Points.")
- main:AddStat(player, "Omega", 75, true)
- main:AddStat(player, "GoldPoints", 7000, true)
- main:SetStat(player, "DaysInARow", 0)
- end
- else
- local Main = player.PlayerGui:FindFirstChild("MainGui")
- if Main then
- local NextDaily = Main:FindFirstChild("NextDaily")
- if NextDaily then
- local Total = (60*60)*0.025
- local Diff = os.difftime(os.time(),Day)
- Total = Total - Diff
- local Hour = math.floor(Total/60/60)
- local Min = math.floor(Total/60-Hour*60)
- local Sec = Total-(Hour*60*60)-(Min*60)
- if Min < 10 then
- Min = "0"..Min
- end
- if Sec < 10 then
- Sec = "0"..Sec
- end
- NextDaily.Text = "Daily Reward in: "..Hour..":"..Min..":"..Sec
- end
- end
- end
- else print("DailyRewards: Error while collecting data from Main") end
- end
- end)
- if not success then
- warn(err)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement