I keep getting an error:
GetAsync is not a valid member of DataStoreService “DataStoreService”
I have no clue on how to fix this if somebody could help it would be appreciated.
local DataStoreService = game:GetService("DataStoreService")
local BanDataStore = DataStoreService:GetAsync("BanDataStore")
game.Players.PlayerAdded:Connect(function(player)
local banned = Instance.new("BoolValue", player)
banned.Name = "banned"
local playerUserId = player.UserId
local bob
local success, errormessage = pcall(function()
bob = BanDataStore:GetAsync(playerUserId)
end)
if bob == true then
game.Players[player.Name].banned.Value = true
else
game.Players[player.Name].banned.Value = false
end
end)