the script woks On studio But it wont Work On The published game
repeat wait() until game.Players.LocalPlayer and game.Players.LocalPlayer.Character local player = game.Players.LocalPlayer char = player.Character hum = char.Humanoid button = script.Parent count = script.Parent.Parent:WaitForChild("CostHC") HC = script.Parent.Parent:WaitForChild("HealthC") price = 75 UP = false max = 200 button.MouseButton1Click:connect(function() local hum = char.Humanoid if hum.MaxHealth == max then elseif player.leaderstats.Money.Value <= price then elseif UP == false then hum.MaxHealth = hum.MaxHealth + 1 player.leaderstats.Money.Value = player.leaderstats.Money.Value - price price = price + 25 count.Text = price HC.Text = HC.Text + 1 end end)
at firs i Was getting an error saying Player attempted to index(nil value) i think that was the error it gave me, bu now i get no output plz he thx :)
A error saying the player is a nil value is most likely to indicate that you're using a server script, when you should be using a local script instead since only a local script can access the LocalPlayer
via the Players
service.