罗布洛克斯工作室:"Argument 1 missing or nil"



我正在测试找到保存数据的脚本。它给了我一条错误消息,上面写着";参数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的变量(,因此,值为nilGetAsync的自变量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

相关内容

最新更新