You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
IM trying to make a system that loops through each badge and if they have said badge it sets its corresponding value to true -
What is the issue? Include screenshots / videos if possible!
on the badge check it is saying argument 2 is nil or missing (badge id is argument 2 - What solutions have you tried so far? Did you look for solutions on the Developer Hub?
i know it has something to do with that I’m not using a number but i have a list of numbers earlier in the script where i give each badge ID a name that matches to the bool value name
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
game.Players.PlayerAdded:Connect(function(player)
local OSVcp = OSV:Clone() --this really isnt important its just cloneing the values
OSVcp.Parent = player
OSVcp.Name = (player.Name .. "Ownerships")
wait()
for i, v in pairs(OSVcp:GetChildren()) do
if badgeservice:UserHasBadgeAsync(player.UserId,tonumber(v.Name)) then -- heres the error part
v.Value = true
print("user has a plush")
elseif not badgeservice:UserHasBadgeAsync(player.UserId, tonumber(v.Name)) or v.Name == nil then
v.Value = false
print("user doesnt have a plush")
end
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.