How do I make this give the player an item?
So one of my scripters created a script so the player would get an item for owning a gamepass, he must have misunderstood me since I asked if the player could get an item for owning a badge. I tried tampering with it a bit and it still doesn't work, any help? Ty
01 | thingtoownid = 660386043 |
04 | multiple = { [ 'Springtime Basket' ] = "id" , goldcoil = "id" , ownerbasket = "id" } |
08 | repeat wait() until script.Parent.Parent.Backpack |
09 | plr = script.Parent.Parent |
10 | if multipleitems = = false then |
13 | items = game.ReplicatedStorage:FindFirstChild(item) |
14 | if items and type (thingtoownid) = = "number" then |
16 | if not script.Parent.Parent.StarterGear:FindFirstChild(item) and game:GetService( "BadgeService" ):UserHasBadge(plr,thingtoownid) then |
18 | s.Parent = script.Parent.Parent.StarterGear |
20 | sa.Parent = script.Parent.Parent.Backpack |
25 | error ( 'No such thing as "' .. item .. '" in replicated storage!' ) |
29 | for i,v in pairs (multiple) do |
30 | items = game.ReplicatedStorage:FindFirstChild( tostring (i)) |
31 | if items and type (v) = = "number" then |
32 | if not script.Parent.Parent.StarterGear:FindFirstChild( tostring (i)) and game:GetService( "MarketplaceService" ):PlayerOwnsAsset(plr,v) then |
34 | s.Parent = script.Parent.Parent.StarterGear |
36 | sa.Parent = script.Parent.Parent.Backpack |
42 | error ( 'No such thing as "' .. tostring (i) .. '" in Replicated Storage! Or gamepass ID "' .. tostring (v) .. '" is invalid for some reason.' ) |