How can I give a player that has a gamepass a certain gear in their in-game inventory?
Thank you!
How can I give a player that has a gamepass a certain gear in their in-game inventory?
Thank you!
That would be pretty easy, you would have a gear in ReplicatedStorage and use the PlayerHasPass method to check if the player has the item. Then, you would clone the gear into the Player's backpack
Example:
function ifplayerhasPass(Player)
return game:GetService("GamePassService"):PlayerHasPass(Player,passid )
end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(Character)
if ifplayerhasPass(player) then
print("Player has the GamePass")
local abc = game.ReplicatedStorage.SpeedCoil:clone()
abc.Parent = player.Backpack
end
end)
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Could you give an example in code block? I'm completely oblivious to how to code Lua