01 | passId = 6632153 --gravity |
02 | passId 2 = 6632270 --speed |
03 | market = game:GetService( "MarketplaceService" ) |
04 |
05 | game.Players.PlayerAdded:Connect( function (player) |
06 | function hasGravityPass(player) |
07 | return market:UserOwnsGamePassAsync(player,passId) |
08 | end |
09 | function hasSpeedPass(player) |
10 | return market:UserOwnsGamePassAsync(player,passId 2 ) |
11 | end |
12 | player.CharacterAdded:Connect( function (char) |
13 | if hasGravityPass() = = true then |
14 | grav = game.ServerStorage.GravityCoil:Clone() |
15 | grav.Parent = player.Backpack |
It is returning with an error of "Argument 1 missing or nil"
01 | passId = 6632153 --gravity |
02 | passId 2 = 6632270 --speed |
03 | market = game:GetService( "MarketplaceService" ) |
04 |
05 | game.Players.PlayerAdded:Connect( function (player) |
06 | player.CharacterAdded:Connect( function () |
07 | if market:UserOwnsGamePassAsync(player.UserId,passId) then |
08 | game.ServerStorage.GravityCoil:Clone().Parent = player:WaitForChild( "Backpack" ) |
09 | end |
10 | if market:UserOwnsGamePassAsync(player.UserId,passId 2 ) then |
11 | game.ServerStorage [ "Acceleration Coil" ] :Clone().Parent = player:WaitForChild( "Backpack" ) |
12 | end |
13 | end ) |
14 | end ) |
this will give them the item when the character has loaded if they have the gamepass