Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

It doesn't give the item when the user came in but the user have the gamepass help?

It doesn't give the item when they user came in but the user have the gamepass help?

local gamePassService = game:GetService("GamePassService")

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function()
		if gamePassService:PlayerHasPass(player,529449047) then
			local sp = game.Lighting:FindFirstChild("Supplier")
			sp:Clone().Parent = player.Backpack
			sp:Clone().Parent = player.StarterGear
		end
	end)
end)


2 answers

✓ Accepted answer

Try using PlayerOwnsAsset it might work , Returns whether the given player has the given asset.


game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function()
		if  game:GetService("MarketplaceService"):PlayerOwnsAsset(player,529449047) then
			local sp = game.Lighting:FindFirstChild("Supplier")
			sp:Clone().Parent = player.Backpack
			sp:Clone().Parent = player.StartGear
		end
	end)
end)




1 comment

0

Thanks

In ROBLOX Studio GamePasses can only be inquired by a ServerScript in a ROBLOX server. Do test not by Studio but by the ROBLOX Player.

1 comment

0

I did but It did not work

This discussion is preserved as it was. New answers, comments, and votes are closed.