Impossible GUI to create?
Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
I've been trying my best to make a GUI with weapon equip options. However, the weapons in the game must be found via Badge collection. So once the badge for the weapon is found, you should be able to click on the GUI button and equip it to the players 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?
My sad attempt ~
02 | badge = game:GetService( "BadgeService" ) |
03 | player = script.Parent.Parent.Parent.Parent.Parent |
05 | function find(userid, badgeid) |
06 | if game:GetService( "BadgeService" ):UserHasBadge(userid, badgeid) then |
07 | clone = game.Lighting.GravityCoil:clone() |
08 | clone.Parent = player.StarterGear |
12 | function MouseClick(hit) |
13 | if (hit.Parent:FindFirstChild( "Humanoid" ) ~ = nil ) then |
14 | local p = game.Players:GetPlayerFromCharacter(hit.Parent) |
16 | if (find(p.userId, badgeholder.Value)) then |
17 | clone = game.Lighting.GravityCoil:clone() |
18 | clone.Parent = player.StarterGear |
19 | elseif (find(p.userId, badgeholder.Value) = = false ) then |
20 | hit.Parent.MouseButton 1 Click:remove() |
23 | script.Parent.MouseButton 1 Click:connect(MouseClick) |