I have a game that uses the game pass service to award extra tools.
It works pretty well.
Another ROBLOX employee bought my game pass this morning, entered the game, and did not get tools. Resetting the place fixed the problem.
Are there known limitations where this call will fail (i.e. return FALSE when the answer should be TRUE)?
There's this neat twitter post detailing the differences between UserHasBadge
, PlayerHasPass
and PlayerOwnsAsset
.
From the looks of it, what you're probably doing is calling PlayerHasPass
before awarding the player the game pass, and then calling it again later once they've received the game pass. Since it returned true after resetting the place, it's probably not in a LocalScript and most likely a caching problem.
If you are trying to give a sword, I would consider using this.
wait(2) gpid = 155854150 tools = {"TOOLNAMEHERE"} -put the sword in Lighting GPS = Game:GetService ("GamePassService") function respawned (char) player = game.Players:FindFirstChild(char.Name) print("Respawned") if char:FindFirstChild("Head") ~= nil then print("It's a Player!") if GPS:PlayerHasPass(player, gpid) then print("Has GPID") for i = 1,#tools do game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack end else print("No GPID") end end end game.Workspace.ChildAdded:connect(respawned)
By default, I use the game:GetService("BadgeService")UserHasBadge(ItemID). It is able to be used with any type of asset, Game Passes, Badges, Models, etc.
Are you sure your function for when a player enters is good? That the event is PlayerAdded, not ChildAdded ? They make a difference.
Locked by adark and Articulating
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?