im trying to make a points left to limit the amount of points a player can put into a stat and roblox studio isnt telling me whats wrong
local textButton = script.Parent
local statvalue = game.Players.LocalPlayer.PlayerGui.ScreenGui.MenuFrame.StrFrame.Stat
_G.PointsLeft = game.Players.LocalPlayer.PlayerGui.ScreenGui.MenuFrame.PointsLeft.Text
_G.spd = 0
_G.str = 0
_G.stattotal = 100 - _G.str - _G.spd
local function onActivated()
if _G.stattotal < 1 then
_G.str = _G.str
elseif _G.stattotal > 1 then
_G.str = _G.str + 1
statvalue = _G.str
end
_G.PointsLeft = _G.stattotal
end
textButton.Activated:Connect(onActivated)```