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)

4 comments
Is this a localscript or serverscript
serverscript
i changed it to a local script and there is still no difference
Hmmmm, as a beginner i would take a look to remove the ')' in-front of 'end' inside of the Script!