local DataStore = game:GetService("DataStoreService"):GetDataStore("LastLogin")
player = game.Players.LocalPlayer
playergui = game.Players.LocalPlayer.PlayerGui.RewardGUI
game.Players.PlayerAdded:connect(function(Player)
local LastLogin = DataStore:GetAsync(Player.userId)
local leaderstats = player:WaitForChild("leaderstats")
if LastLogin then
local Seconds = tick()-LastLogin
local Minutes = Seconds/60
local Hours = Minutes/60
playergui.TimeFrame.TextLabel.Text = ("Next Award In: "..Hours.."")
if Hours >= 24 then
playergui.NotificationFrame.Visible = true
for SoundNum = 1, 7 do
script.Parent["CointDrop"..SoundNum]:Play()
wait(.1)
end
leaderstats.Coins.Value = leaderstats.Coins.Value +100
wait(2)
playergui.NotificationFrame.Visible = false
DataStore:SetAsync(Player.userId,tick())
end
else
DataStore:SetAsync(Player.userId,tick())
end
end)
The output is telling me: Workspace.Script:3: attempt to index field 'LocalPlayer' (a nil value)
I don't know what this means and what i'm supposed to fix :/
