Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

-- 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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.