Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I change my hp to souls it works but when i get hit buy an enemy my hp resets on 100?

Asked by 4 years ago

I have a localscript on StarterCharacterScripts where to change my health to souls but its not saving and when i test i got the souls like my health but when an enemy attack me my health reset on 100 but i have 1k souls what should i do help me please thank you.

local Player = game.Players.LocalPlayer local Souls = Player:WaitForChild('leaderstats'):FindFirstChild('Souls') local char = Player.Character or Player.CharaterAdded:Wait()

Souls.Changed:Connect(function() char:WaitForChild('Humanoid').MaxHealth = Souls.Value char:WaitForChild('Humanoid').Health = Souls.Value end)

Answer this question