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

Any one able to help me fix this - Argument 2 missing or nil?

Asked by 5 years ago
Edited 5 years ago
-- Sever-script in ServerScriptService
local DataStoreService = game:GetService("DataStoreService")
local TrailDs = DataStoreService:GetDataStore("Trails")
local Trails = {}

if Trails["Blue"] == nil then
    table.insert(Trails, "Blue")
end

Trails = TrailDs:GetAsync(plr.UserId)
TrailDs:SetAsync(plr.UserId, Trails)

I've looked on the internet but cant find a fix, i feel like its a simple fix but im not able to see it, also error is on line 11. Thanks in advance!

1 answer

Log in to vote
0
Answered by 5 years ago

Doesnt matter now i fixed it

local DataStoreService = game:GetService("DataStoreService")
local TrailDs = DataStoreService:GetDataStore("Trails")
Trails = TrailDs:GetAsync(plr.UserId)

if Trails == nil then
    print("Nil")
    Trails = {}
    table.insert(Trails, "Blue")
else
    print("Not nill")
end

TrailDs:SetAsync(plr.UserId, Trails)
Ad

Answer this question