Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Repeat loop ending early while comparing creatorId?

Asked by
Hypgnosis 186
5 years ago
Edited 5 years ago

Hello!

I am trying to figure out how I can get the template id from a clothing id.

My repeat loop ends after only one subtraction, meaning that it ends with shirtID equaling 2574442245, when it should continue until it finds a matching userId to the creator of the shirt.

local marketplace = game:GetService('MarketplaceService')

local shirt = character:WaitForChild('Shirt')
local shirtID = 2574442246
local shirtInfo = marketplace:GetProductInfo(shirtID)
local shirtCreatorID = shirtInfo.Creator.CreatorTargetId

repeat 
    shirtID = shirtID - 1 
    wait() 
until 
    shirtCreatorID == shirtCreatorID  

shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=".. shirtID
1
MarketplaceService has a function I believe User#24403 69 — 5y
0
You put me on the right track, but now I'm having more trouble. Hypgnosis 186 — 5y

Answer this question