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

Give tool on spawn if player owns gamepass not working?

Asked by 6 years ago
Edited 6 years ago
GPS = game:GetService("GamePassService")
local ServerStorage = game:GetService('ServerStorage')
local Tools = ServerStorage:WaitForChild('Tools')

game.Players.PlayerAdded:connect(function(Player) -- The Force Gamepass
    Player.CharacterAdded:connect(function()

        local GPID = 4349518

        if GPS:PlayerHasPass(Player, GPID) then
            local Force = Tools:WaitForChild('The Force'):Clone()
            Force.Parent = Player.Backpack
        end
    end)
end)

game.Players.PlayerAdded:connect(function(Player) -- Channel Hatred Gamepass
    Player.CharacterAdded:connect(function()

        local GPID = 4351141

        if GPS:PlayerHasPass(Player, GPID) then
            local ChannelHatred = Tools.ChannelHatred:Clone()
            ChannelHatred.Parent = Player.Backpack
        end
    end)
end)

^^ Yes, the tools do exist under the "Tools" folder inside of ServerStorage. And yes, this game is Filtering Enabled. Any suggestions? This script is located inside of ServerScriptService in case you were wondering.

Answer this question