我正在测试找到保存数据的脚本。它给了我一条错误消息,上面写着";参数1丢失或为零";。这是代码:
local DataStoreService = game:GetService("DataStoreService") -- makes the variable for the data store service
local DataStore = DataStoreService:GetDataStore("Data") -- makes the variable for the "Data" data store
local GlobalShutdowns = DataStore:GetAsync(GlobalShutdownsData) -- finds the "GlobalShutdownsData" data from the data store service
请帮帮我!
调用GetAsync
时忘记添加引号。这使鲁相信GlobalShutdownsData
是一个变量。未定义GlobalShutdownsData
(没有名为GlobalShutdownsData
的变量(,因此,值为nil
。GetAsync
的自变量1是nil
。
local DataStoreService = game:GetService("DataStoreService") -- makes the variable for the data store service
local DataStore = DataStoreService:GetDataStore("Data") -- makes the variable for the "Data" data store
--fix below
local GlobalShutdowns = DataStore:GetAsync("GlobalShutdownsData") -- finds the "GlobalShutdownsData" data from the data store service