Players are able to purchase the game pass, however it doesn’t award them the tool (includes when re-joining a server).
Current code:
local GamePassId = 19711172
game.Players.PlayerAdded:Connect(function(player)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamePassId) then
game.ServerStorage.Gravitycoil:Clone().Parent = player:WaitForChild("Backpack")
game.ServerStorage.Gravitycoil:Clone().Parent = player:WaitForChild("StarterGear")
end
local GamePassId = 19711172
game.Players.PlayerAdded:Connect(function(player)
end)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamePassId) then
game.ServerStorage.Gravitycoil:Clone().Parent = player:WaitForChild("Backpack")
game.ServerStorage.Gravitycoil:Clone().Parent = player:WaitForChild("StarterGear")
end
ServerScriptService.Script:8: attempt to index nil with ‘UserId’ - Server - Script:8 (Seems to be an error).
Gravity coil tool, is still not given after purchasing in testing
local MarketPlaceService = game:GetService("MarketplaceService")
local GamePassId = 19711172
game.Players.PlayerAdded:Connect(function(player)
end)
if MarketPlaceService:UserOwnsGamePassAsync(player.UserId, GamePassId) then
game.ServerStorage.Gravitycoil:Clone().Parent = player:WaitForChild("Backpack")
game.ServerStorage.Gravitycoil:Clone().Parent = player:WaitForChild("StarterGear")
end
Sorry, the scripts always had it at the top - somehow through pasting it cropped it out
I edited my code. It should work but why do you clone it in Bacpack and StarterPack? Wouldn’t it give the player two coils? I suggest only cloning in StarterPack.