I have it in a button, it works perfectly fine in studio but doesnt in game. There's no errors either.
local Player = script.Parent.Parent.Parent
local Humanoid = Player.Character.Humanoid
local value = "Power"
script.Parent.Train.MouseButton1Click:Connect(function()
wait(1)
Player.leaderstats[value].Value = Player.leaderstats[value].Value + 1
local health = Humanoid.Health
local power = Player.leaderstats[value].Value
local newhealth = health*power
Humanoid.MaxHealth = newhealth
end)

1 comment
This doesn't work in game because of FilteringEnabled, in FE, clients don't replicate to the server, so you'll have to use remote events to change things like leaderstats