I created a game badge That cost 100 robux and it did not do a thing! it was a waste of robux! How do I get it to do a specific effect?
COMMUNITY QUESTION
how do I get a game badge to do a effect?
1 answer
Try using an if statement and PlayerOwnsAsset.
You can take a look at the PlayerOwnsAsset function here: http://wiki.roblox.com/index.php?title=API:Class/MarketplaceService/PlayerOwnsAsset
Here is a script that checks if the player joins one game with the target badge.
local id = 0000000 -- Replace this with your badge ID.
game.Players.PlayerAdded:connect(function(plr) -- A player has added.
if game:GetService("MarketplaceService"):PlayerOwnsAsset(plr, id) then -- Check to see if the player has the asset.
--Do something.
print(plr.Name" has this asset!!!") --Example.
end
end
Also, ROBLOX studio now has a mock purchase feature, which you can perform purchases in studio without spending anything. Yes, ANYTHING!!!! So, you can now go to studio and check to see if your badge or purchase script is working.
If you have any problems, please leave a comment down below. Thank you and I hope this will help you.
This discussion is preserved as it was. New answers, comments, and votes are closed.
