Anyways, what I am trying to make is a script that if they have the specific game pass, they can have infinite stamina, but the stamina value is located in the backpack, under a local script named globalfunctions. The problem is that for some reason it cant seem to find "Backpack".
local passId = 318909278
function isAuthenticated(player)
return game:GetService("GamePassService"):PlayerHasPass(player, passId)
end
game.Players.PlayerAdded:connect(function(plr)
if isAuthenticated(plr) then
repeat wait() until plr.Backpack.GlobalFunctions.Stamina
spawn(function()
while wait() do
plr.Backpack.GlobalFunctions.Stamina.Value = 100
end
end)
end
end)
Anyways, output says this: http://prntscr.com/91oxpt
