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

Gamepass Weapon Scripts not functioning?

Asked by 6 years ago
local passid = 874118916
local tool = game.Lighting.Glock
local GamePassService = Game:GetService('GamePassService')
game.Players.PlayerAdded:connect(function(player)
    repeat wait(0.1) until player.Backpack 
    repeat wait(0.1) until player.StarterGear
    if GamePassService:PlayerHasPass(player, passid) then
        local tool1 = tool:Clone()
        local tool2 = tool:Clone()
        tool1.Parent = player.Backpack
        tool2.Parent = player.StarterGear
    end
end)

local passId = 874118916 

function isAuthenticated(player)
    return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end

game.Players.PlayerAdded:connect(function(plr)
    if isAuthenticated(plr) then
        local dsw = game.ServerStorage.Glock:Clone()
        if plr:FindFirstChild("Backpack") then
            dsw.Parent = plr.Backpack
        end
        if plr:FindFirstChild("StarterGear") then
            dsw.Parent = plr.StarterGear
        end
    end

So I've tried both of these scripts and neither are working and the model is in the correct spot can anyone help? I want this script to give the player who bought the game pass a weapon and its not working. I've looked around this website as well and none of them have helped either not sure if im doing it wrong or what.

0
You should use MarketPlaceService instead. Gey4Jesus69 2705 — 6y
0
Even then it still doesnt work Arceptor 0 — 6y
0
We need more info than "it's not working" cabbler 1942 — 6y

Answer this question