I've been trying to make this pet ability where when the pet is equipped, it gives a certain amount of hearts (the currency) per second.
I have this in leaderstats:
if game.Players.LocalPlayer.PetsEquiped("1").Value == "pet1" then while true do game.Players.LocalPlayer.leaderstats.Hearts.Value = game.Players.LocalPlayer.leaderstats.Hearts.Value + 2 wait(1) end end
1 is the pet name, pet1 is the value of 1 when the pet becomes a StringValue under the folder called PetsEquiped.
I've tried putting this in its own script under the pet itself, and I've tried doing other similar variations of this where I just change the first line, for example
if game.Players.LocalPlayer.PetsEquiped("1") then while true do game.Players.LocalPlayer.leaderstats.Hearts.Value = game.Players.LocalPlayer.leaderstats.Hearts.Value + 2 wait(1) end end
Nothing seems to work, so if anyone could at least guide me in a direction as to what I should be doing, that would be helpful, thank you.