So i tried making it so you can buy more max health in my game With click detectors But.. it dosent work and there isnt even any errors
local part = script.Parent local detector = part.ClickDetector detector.MouseClick:Connect(function(player) local leaderstats = player.leaderstats if leaderstats.Money.Value >= 8 then leaderstats.Money.Value -= 8 leaderstats.MaxHealth += 12 player.Character.Humanoid.MaxHealth += 12 end end)
I Found the problem and fixed it but i tried making it so it saves after you die But for some reason it dosent work
https://scriptinghelpers.org/questions/132744/local-script-dosent-save-max-health-upgrades
Have you tried removing the ')' in-front of the 'end' in the Script? You can very easily get wrong.
Alright this is another answer since of 2 nd answered.
If you want to save (132744), make sure you have enabled API and soemthing in game that can be saved. That's my opinion as an early beginner