Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago
Edited 8 years ago

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

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

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)
0
Thanks MortusRPGPlayer 5 — 8y
Ad
Log in to vote
0
Answered by
rexbit 707 Moderation Voter
8 years ago
Edited 8 years ago

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.

0
I did but It did not work MortusRPGPlayer 5 — 8y

Answer this question