local DataStore = game:GetService("DataStoreService"):GetDataStore("LastLogin")
game.Players.PlayerAdded:connect(function(Player)
local LastLogin = DataStore:GetAsync(Player.userId)
local leaderstats = player:WaitForChild("leaderstats") -- switched to WFC, will yield
if LastLogin then
local Seconds = tick()-LastLogin
local Minutes = Seconds/60
local Hours = Minutes/60
script.Parent.TimeFrame.TextLabel.Text = ("Next Award In: "..Hours.."")
if Hours >= 24 then
script.Parent.NotificationFrame.Visible = true
-- This can be a for loop
for SoundNum = 1, 7 do
script.Parent["CointDrop"..SoundNum]:Play()
wait(.1)
end
leaderstats.Coins.Value = leaderstats.Coins.Value +100
wait(2)
script.Parent.NotificationFrame.Visible = false
DataStore:SetAsync(Player.userId,tick())
end
else
DataStore:SetAsync(Player.userId,tick())
end
end)
The output is telling me nothing that could tell me what's wrong with the script. This is a local script inside of a ScreenGui. The screen gui contains 2 frames named NotificationFrame and TimeFrame.
