I am trying to make a script where it saves a value if you played during beta, but I gives me the error 19:49:51.758 - 104: Cannot store Instance in data store. Data stores can only accept valid UTF-8 characters. Code:
local betastatus = game:GetService('DataStoreService'):GetDataStore('Tester')
local status = game:GetService('ServerStorage'):WaitForChild('BetaStatus')
game.Players.PlayerAdded:Connect(function(player)
local scope = 'userid-' .. player.userId
status.Value = betastatus:GetAsync(scope)
print('Set')
status.Changed:Connect(function()
local scope = 'userid-' .. player.userId
betastatus:SetAsync(status.Value, scope)
print('Saved')
end)
end)
game.Players.PlayerAdded:Connect(function(player)
if status.Value == 1 then
status.Value = 2
print('Now a beta tester!')
betastatus:SetAsync(status.Value, player)
print('Saved!')
elseif status.Value == 2 then
print('Already a beta tester!')
end
end)
I am just wondering where the error is and how to fix it :D *1 = false *2 = true

1 comment
Thx :)