Keep getting this issue, Most likely from the bottom portion where im updating the points, but for some reason, i cant find a way to change it or fix it without the script not working anymore.
I tried changing "SetAsync" to UpdateAsync, but that didnt work aswell.
local UpdatePoints = coroutine.wrap(function()
while wait(WaitTime) do
if player:GetRankInGroup(GroupId) >= MinRank then
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamePassx2Id) == true then
coinStat.Value = coinStat.Value + (DefaultPoints*2)
end
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamePassx5Id) == true then
coinStat.Value = coinStat.Value + (DefaultPoints*5)
end
elseif MarketplaceService:UserOwnsGamePassAsync(player.UserId, GamePassx2Id) and MarketplaceService:UserOwnsGamePassAsync(player.UserId,GamePassx5Id) == true then
coinStat.Value = coinStat.Value + 35
else
coinStat.Value = coinStat.Value + (DefaultPoints)
end
end
end)
UpdatePoints()
coinStat.Changed:connect(function(Val)
DataStore:SetAsync("Coin_"..player.Name, Val)
end)
