Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there anything I can add to this script to make it wait for the loading screen GUI be over?

Asked by 4 years ago

I have a loading screen and this GUI loads in at the same time and looks cluttered.. The Script:

local DataStore = game:GetService("DataStoreService"):GetDataStore ("DailyRewards")

local hourWait = 24

local possibleRewards = {10,15,10,10,10,5,5,5,5,5,5,5,5,5,5,5,10,10,10,10,10,10,15,15,15,750}

game.Players.PlayerAdded:Connect(function(player)

01local leaderstats = Instance.new("Folder")
02leaderstats.Name = "leaderstats"
03leaderstats.Parent = player
04 
05local coins = Instance.new("IntValue")
06coins.Name = "Coins"
07coins.Parent = leaderstats
08 
09local timeNow = os.time()
10 
11local data
12 
13pcall(function()
14    data = DataStore:GetAsync(player.UserId.."-dailyReward")
15    print("Getting Data")
View all 57 lines...

end)

game.Players.PlayerRemoving:Connect(function(player) local data pcall (function() data = DataStore:GetAsync(player.UserId.."-dailyReward") print("Getting the data") end)

1if data == nil then
2    -- New player
3    pcall(function()
4    local timeVal = os.time()
5        DataStore:SetAsync(player.UserId.."-dailyReward")
6        end)
7    print ("Saved because your a new player")
8end

end)

Answer this question