Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

What's the reverse of :PlayerOwnsAsset?

So I'm doing a self check-in, and I wanna redirect a player to an endpoint if the player doesn't own said asset. I would think the following would work

elseif MarketplaceService:PlayerOwnsAsset(Player, Asset) then

but after I thought about it, elseif isn't really saying it's false, and I can't just add a == false to it or anything. Is there an easy way to do this because I'm lazy and I wanna get this finished lol.

2 answers

Maybe use "break" or "not"

4 comments

0

Can you elaborate, I don't know how I could use break, because I'm pretty sure it just breaks the loop, and not wouldn't work in this case.

0

Actually, yeah. not worked. Thanks. I put the not in the wrong place first time because I'm an idiot.

0

You could use == false since PlayerOwnsAsset() returns a boolean.

0

break wouldn't be useful in this type of situation.

This is pretty simple, just add "not" before the statement

if not MarketplaceService:PlayerOwnsAsset(Player, Asset) then -- If player doesn't own Asset then

end

2 comments

0

Or you could've just done an else.

0

True.

This discussion is preserved as it was. New answers, comments, and votes are closed.