So, here is the script that awards the player the gear if they have a GAMEPASS
01 | wait( 2 ) |
02 |
03 | gpid = 1111111111 |
04 | tools = { "gear" } |
05 |
06 | GPS = Game:GetService( "GamePassService" ) |
07 | function respawned(char) |
08 | player = game.Players:FindFirstChild(char.Name) |
09 | print ( "Respawned" ) |
10 | if char:FindFirstChild( "Head" ) ~ = nil then |
11 | print ( "A wild player has appeared!" ) |
12 | if GPS:PlayerHasPass(player, gpid) then |
13 | print ( "Has GPID" ) |
14 | for i = 1 ,#tools do |
15 | game.Lighting:FindFirstChild(tools [ i ] ):Clone().Parent = player.Backpack |
Anyone know how to edit it to make it so you have a badge, then it awards the gear? Also, if you already know a have badge award gear script, just post it here.
NOTE: The gear needs to be grabbed out of ingame, in a spot such as lighting. Not from the catalog.
I suppose you want a script that gives the player a gear if they have a badge when they join the game or respawn (if they earn the badge they can use the gear simply by respawning).
01 | badgeid = 123456789 -- id of badge needed |
02 | toolstorage = game.ServerStorage -- where to store the gear(s) |
03 | tools = { "Gear" } -- names of the tools (you can put as many as you want) |
04 |
05 | game.Players.PlayerAdded:connect( function (p) |
06 | p.CharacterAdded:connect( function (c) |
07 | if game:GetService( "BadgeService" ):UserHasBadge(p.userId, badgeid) then |
08 | for i,v in pairs (tools) do |
09 | local clone = toolstorage:WaitForChild(v):Clone() |
10 | clone.Parent = p.Backpack |
11 | end |
12 | end |
13 | end ) |
14 | end ) |
I'm not sure if this works. Please tell me if it does :)
EDIT: Trying to see if I can make it award instantly
EDIT 2: Improved