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

Why is this not Saving or Loading?

Asked by 9 years ago

So, this script is supposed to Save and Load the time spent in-game by the people above or that rank in the group, but it prints this error after it has counted 1 minute, can anyone help me understand why it thinks it is missing or nil?

-- Argument 2 missing or nil

-- Script 'ServerScriptService.StaffTime.StaffTimeCounter', line 74 - global TimeCount

-- Script 'ServerScriptService.StaffTime.StaffTimeCounter', line 94

-- Stack end

The script is:

001-- Primary Variables:
002local DataStore     = game:GetService('DataStoreService'):GetDataStore('StaffTime');
003 
004local SP            = script.Parent;
005 
006local Users         = SP:WaitForChild('Users');
007local Default       = Users:WaitForChild('Default');
008 
009local Settings      = require(SP:WaitForChild('Settings'));
010local GroupId       = Settings.GroupId;
011local StaffRank     = Settings.StaffRank;
012local ViewerRank    = Settings.ViewerRank;
013 
014-- Primary Functions:
015function CreatePlayerTime(Player)
View all 103 lines...
1
You are caling the function therefore passing whatever that function returns to UpdateAsync. Create an annymous function to call SaveTime. Also to save a table you have to encode it in  JSON. NotsoPenguin 705 — 9y
0
Thank you, it works fine now! Shrekerly 70 — 9y

Answer this question