local badgeId = 242823741
local owner = script.Parent.Parent.Parent.Parent.Owner.Value
while wait() do
if script.Parent.Parent.Parent.Name == "PurchasedObjects" then
if game:GetService("BadgeService"):UserHasBadge(owner.userId, badgeId) then
script.Parent.Got.Value = true
break
end
end
end
This script works, so nothing needs to be changed, but I was wondering if it was possible to make it more simple and create less lag cause I know while wait() do is not the best way for loops as it does cause a lot of lag. Any ideas?
- NinjoOnline

2 comments
Is it possible to put this code into an event, e.g. when a player joins the game? this would remove the need for the loop
What kind of lag are you getting whith this script. In roblox studio go to view->script performance. This will show you the scripts actvity and performance