-
What do you want to achieve?
Im trying to make an RPG level up system, where the player can upgrade their stats when they press the GUI button -
What is the issue?
Whenever they press the button, the GUI gets hidden, but the health and jump power don’'t change. -
What solutions have you tried so far?
I added a print to the script and it still prints the message, but the stats dont change.
Not working script
local player = game:GetService("Players").LocalPlayer -- Defines the local player
local health = player.Character.Humanoid.MaxHealth -- Defines the player's health
local jump = player.Character.Humanoid.JumpPower -- Defines the player's jump power
script.Parent.MouseButton1Click:Connect(function() -- Activates the function once the stats button is pressed
script.Parent.Parent.Visible = false -- Disables the level up screen
health = health + 15 -- Increases the player's health by 15
jump = jump + 5 -- Increases the player's jump power by 5
print("pls print me") -- Print in the log for testing
end)