Local Badge script error?
I've been trying my best to make a GUI with weapon equip options. However, the weapons in the game should only be accessed if the player has the certain badge collected. So once the badge for the weapon is found, you should be able to click on the GUI button and equip it to your inventory, if it isn't found then the equip button should be disabled. I'm confident I'm just following the wrong guidelines to make it, any options for this?
The following script doesn't work properly for some odd reason:
02 | local badge = game:GetService( "BadgeService" ) |
03 | local player = game.Players.LocalPlayer |
05 | function find(userid, badgeid) |
06 | if badge :UserHasBadge(userid, badgeid) then |
07 | local clone = game.ReplicatedStorage.GravityCoil:clone() |
08 | local clone 2 = game.ReplicatedStorage.GravityCoil:clone() |
09 | clone.Parent = player.Backpack |
10 | clone 2. Parent = player.StarterGear |
12 | script.Parent.MouseButton 1 Click:Destroy() |
17 | script.Parent.MouseButton 1 Click:connect( function () find(player.userId, ID) end ) |