The error for the script is: local player = game.Players.LocalPla:3: attempt to index global 'script' (a nil value) If you're wondering, number is a stringValue and upgrade is an IntValue.
local pass = 182358984 local player = game.Players.LocalPlayer upgrade = script.Parent.Parent.TextLabel.Upgrade number = script.Parent.Parent.TextLabel.Number function Auth(player) return game:GetService("GamePassService"):PlayerHasPass(player, pass) end script.Parent.MouseButton1Click:connect(function() if Auth() then upgrade.Value = 3 else upgrade.Value = 1 end number.Value = number.Value + upgrade.Value end)
I don't see why you're getting that error specifically, but there is a bug in this code, specifically the Auth
function.
You define Auth
with a player
parameter, overriding your player
local variable for the scope of the function. Then, when you call Auth
, you don't pass in any argument.
To fix that, just remove player
from the parameter list for Auth
.