When I was scripting, the main problem when I press the R button to increase my max HP and also the HP, when I get damaged the HP will not be at 250 but stuck on 100 HP. How can I fix this script? Heres the current script down below.

Specials = {
	Awaken = {
		Enabled = true,
		Active = false,
		ReloadTime = 10,
		Duration = 60,
	}
}
jun = script.Parent.Parent
local m = game.Players.LocalPlayer:GetMouse()
db = true
m.KeyDown:connect(function(k)
	k = k:lower()
	if k == "r" then
			local Special = Specials.Awaken
			if not Special.Enabled or Special.Active then
				return
			end
			Special.Enabled = false
			Special.Active = true
		if db == true then
			print("Sucessfuly Awakened")
			local Awaken = Instance.new("Animation")
			Awaken.AnimationId = "http://www.roblox.com/asset/?id=3249872805"
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0
			local LoadAnimation = game.Players.LocalPlayer.Character.Humanoid:LoadAnimation(Awaken)
			LoadAnimation:play()
			wait(0.7)
			local t = Instance.new("Explosion")
			t.Parent = game.Players.LocalPlayer.Character.Torso
			t.Position = (game.Players.LocalPlayer.Character.Torso.Position)
			t.DestroyJointRadiusPercent = 0
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 30
			game.Players.LocalPlayer.Character.Humanoid.MaxHealth = 250
			wait(0.1)
			game.Players.LocalPlayer.Character.Humanoid.Health = 250
			local fr = game.lighting.SB1:clone()
			fr.Parent = jun.Character.Torso
			local fr = game.lighting.SB2:clone()
			fr.Parent = jun.Character.Torso
			local fr = game.lighting.SB3:clone()
			fr.Parent = jun.Character.Torso
			local fr = game.lighting.SB4:clone()
			fr.Parent = jun.Character.Torso
			local fr = game.lighting.SB5:clone()
			fr.Parent = jun.Character.Torso
			local fr = game.lighting.PointLight:clone()
			fr.Parent = jun.Character.Torso
			local s = Instance.new("Sound")
			s.Name = "Sound"
			s.SoundId = "http://www.roblox.com/asset/?id=574662273" 
			s.Pitch = 1
			s.Volume = 2
			s.Parent = game.Workspace
			s:Play()
			wait(1)
			local t = t:Destroy()
			Special.Enabled = false
			wait(Specials.Awaken.Duration)
			Special.Active = false
			print("Awaken Finished, Reloading in 15 seconds")
			local fr = game.Players.LocalPlayer.Character.Torso.SB1:Destroy()
			local fr = game.Players.LocalPlayer.Character.Torso.SB2:Destroy()
			local fr = game.Players.LocalPlayer.Character.Torso.SB3:Destroy()
			local fr = game.Players.LocalPlayer.Character.Torso.SB4:Destroy()
			local fr = game.Players.LocalPlayer.Character.Torso.SB5:Destroy()
			local fr = game.Players.LocalPlayer.Character.Torso.PointLight:Destroy()
			wait(1)
			game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 16
			game.Players.LocalPlayer.Character.Humanoid.Health = 100
			game.Players.LocalPlayer.Character.Humanoid.MaxHealth = 100
			s:Stop()
			wait(Specials.Awaken.ReloadTime)
			Special.Enabled = true
			Special.Active = false
			print("Awaken Reloaded")
		end
	end
end)

1 comment

0

Taken from a free model