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

How do I make someone recieve a item via badge?

Asked by
Lopous 1
7 years ago

This is kind of like my gamepass question, but about the gamepass, I just want them to have this item forever, no matter how many times they die or so.

That's pretty much it...

They must have the badge in order to get the item.

1 answer

Log in to vote
0
Answered by
xuefei123 214 Moderation Voter
7 years ago

hey there! You would need to use UserHasBadge, and if they do find your item and clone it to their backpack/wherever it is needed

Here is an example;

local BadgeId = 123
--Change ^ To the badge Id

game.Players.PlayerAdded:connect(function(p)
    if game:GetService("BadgeService"):UserHasBadge(p.userId, BadgeId) then
        print("The user has this badge")
    --give item
    else
        print("The user does not have this badge")
    --remove this if you want, it is not needed
    end
end)

If this helped leave a thumbs up, and accept the answer, it gives us both rep!

0
Where do I input the item ID or? Lopous 1 — 7y
0
In the variable "BadgeId" xuefei123 214 — 7y
Ad

Answer this question