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

Why is this gamepass script not actually giving the weapon to my players?

Asked by
Azuc 112
5 years ago

It seems so simple im not sure whats going wrong here, no errors or anything.

local id = 103728213
local tool = game.ServerStorage.Guns.Gamepass["MP40"]

game.Players.PlayerAdded:connect(function(player)
    if game:GetService("GamePassService"):PlayerHasPass(player, id) then 
        tool:clone().Parent = player.Backpack
        tool:clone().Parent = player.StarterGear
        else
    end
end)
1
Stop using PlayerHasPass, use UserOwnsGamePassAsync Rare_tendo 3000 — 5y
0
Use; game:GetService("MarketPlaceService"):UserOwnsGamePassAsync() Ince_FS 13 — 5y
0
Yeah even with those changes its still not working Azuc 112 — 5y
0
You want a instant change? Ince_FS 13 — 5y
0
if is how i do think, then see this, i think this can help you; https://www.robloxdev.com/articles/Game-Passes-One-Time-Purchases Ince_FS 13 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
local id = 103728213
local tool = game.ServerStorage.Guns.Gamepass["MP40"]

game.Players.PlayerAdded:connect(function(player)
    if game:GetService("GamePassService"):PlayerHasPass(player, id) then
        local clonedtool = tool:Clone()
        clonedtool.Parent = player.Character.Backpack -- if backpack is in local player's model
        local clonedtool = tool:Clone() -- if you want to clone it twice
        clonedtool.Parent = Player.StarterGear
        else
    end
end)
Ad

Answer this question