import "macros" as { $ } $load $FILE -- Heliodex's basic New function (basically a simplified version of melt) New = (className, name, props) -> if props == nil -- no name was provided props = name name = nil obj = Instance.new className obj.Name = name if name local parent for k, v in pairs props if type(k) == "string" if k == "Parent" parent = v else obj[k] = v elseif type(k) == "number" and type(v) == "userdata" v.Parent = obj obj.Parent = parent obj -- damageGuiWidth = 5.0 damageGuiHeight = 5.0 waitForChild = (parent, childName) -> child = parent\findFirstChild childName if child return child while true child = parent.ChildAdded\wait! if child.Name == childName return child -- declarations Figure = script.Parent Humanoid = waitForChild Figure, "Humanoid" Torso = waitForChild Figure, "Torso" config = Figure\FindFirstChild "PlayerStats" inCharTag = New "BoolValue" Name: "InCharTag" hider = New "BoolValue" Name: "RobloxBuildTool" if config == nil config = New "Configuration", "PlayerStats" Parent: Figure myHealth = config\FindFirstChild "MaxHealth" if myHealth == nil myHealth = New "NumberValue", "MaxHealth" Value: 100 Parent: config Humanoid.MaxHealth = myHealth.Value Humanoid.Health = myHealth.Value onMaxHealthChange = -> Humanoid.MaxHealth = myHealth.Value Humanoid.Health = myHealth.Value myHealth.Changed\connect onMaxHealthChange --Humanoid.MaxHealth = myHealth.Value --Humanoid.Health = Humanoid.MaxHealth vPlayer = game.Players\GetPlayerFromCharacter script.Parent dotGui = vPlayer.PlayerGui\FindFirstChild "DamageOverTimeGui" if dotGui == nil dotGui = New "BillboardGui", "DamageOverTimeGui" Parent: vPlayer.PlayerGui Adornee: script.Parent\FindFirstChild "Head" Active: true size: UDim2.new damageGuiWidth, 0, damageGuiHeight, 0.0 StudsOffset: Vector3.new 0, 2.0, 0.0 print "newHealth declarations finished" billboardHealthChange = (dmg) -> with New "TextLabel", Text: "#{dmg}" TextColor3: Color3.new if dmg > 0 0, 1, 0 else 1, 0, 1 size: UDim2.new 1, 0, 1, 0.0 Active: true FontSize: 6 BackgroundTransparency: 1 Parent: dotGui for t = 1, 10 wait 0.1 .TextTransparency = t / 10 .Position = UDim2.new 0, 0, 0, -t * 5 .FontSize = 6 - t * 0.6 \remove! setMaxHealth = -> --print Humanoid.Health if myHealth.Value >= 0 Humanoid.MaxHealth = myHealth.Value print Humanoid.MaxHealth if Humanoid.Health > Humanoid.MaxHealth Humanoid.Health = Humanoid.MaxHealth myHealth.Changed\connect setMaxHealth -- Visual Effects -- fireEffect = New "Fire", "FireEffect" Heat: 0.1 Size: 3.0 Enabled: false -- -- regeneration while true s = wait 1 health = Humanoid.Health if health > 0 -- and health < Humanoid.MaxHealth delta = 0 if config regen = config\FindFirstChild "Regen" poison = config\FindFirstChild "Poison" ice = config\FindFirstChild "Ice" fire = config\FindFirstChild "Fire" stun = config\FindFirstChild "Stun" with regen do if regen delta += .Value.X if .Value.Y >= 0 .Value = Vector3.new .Value.X + .Value.Z, .Value.Y - s, .Value.Z -- maybe have 3rd parameter be an increaser/decreaser? elseif .Value.Y == -1 .Value = Vector3.new .Value.X + .Value.Z, -1, .Value.Z else \remove! -- infinity is -1 with poison do if poison delta -= .Value.X if .Value.Y >= 0 .Value = Vector3.new .Value.X + .Value.Z, .Value.Y - s, .Value.Z elseif .Value.Y == -1 .Value = Vector3.new .Value.X + .Value.Z, -1, .Value.Z else \remove! -- infinity is -1 with ice do if ice --print "IN ICE" delta -= .Value.X if .Value.Y >= 0 .Value = Vector3.new .Value.X, .Value.Y - s, .Value.Z else \remove! with fire do if fire fireEffect.Enabled = true fireEffect.Parent = Figure.Torso delta -= .Value.X if .Value.Y >= 0 .Value = Vector3.new .Value.X, .Value.Y - s, .Value.Z else \remove! fireEffect.Enabled = false fireEffect.Parent = nil if stun local backpackTools if stun.Value > 0 Torso.Anchored = true currentChildren = script.Parent\GetChildren! backpackTools = game.Players\GetPlayerFromCharacter(script.Parent).Backpack\GetChildren! for i in *currentChildren if i.className == "Tool" inCharTag\Clone!.Parent = i print backpackTools table.insert backpackTools, i for i in *backpackTools if not i\FindFirstChild"RobloxBuildTool"? hider\Clone!.Parent = i i.Parent = game.Lighting wait 0.2 for i in *backpackTools i.Parent = game.Players\GetPlayerFromCharacter(script.Parent).Backpack stun.Value = stun.Value - s else Torso.Anchored = false for i in *backpackTools i\FindFirstChild"RobloxBuildTool"?\Remove! i.Parent = game.Lighting wait 0.2 for i in *backpackTools wasInChar = i\FindFirstChild "InCharTag" i.Parent = if wasInChar wasInChar\Remove! script.Parent else game.Players\GetPlayerFromCharacter(script.Parent).Backpack stun\Remove! if delta ~= 0 coroutine.resume coroutine.create(billboardHealthChange), delta --delta *= .01 --health += delta * s * Humanoid.MaxHealth health = Humanoid.Health + delta * s Humanoid.Health = if health * 1.01 < Humanoid.MaxHealth health --myHealth.Value = math.floor Humanoid.Health elseif delta > 0 Humanoid.MaxHealth --myHealth.Value = Humanoid.Health