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

how do I get a game badge to do a effect?

Asked by 7 years ago

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?

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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.

Ad

Answer this question