diff --git a/CSMPFunctions.lua b/CSMPFunctions.lua index 32f5947..7c9a58e 100644 --- a/CSMPFunctions.lua +++ b/CSMPFunctions.lua @@ -279,6 +279,8 @@ function CSServer(Port,PlayerLimit) game.Workspace:InsertContent("rbxasset://Fonts//Health2010.rbxm"); elseif (rbxlegacyversion == "delta") then game.Workspace:InsertContent("rbxasset://Fonts//Health2011.rbxm"); + elseif (rbxlegacyversion == "omega") then + game.Workspace:InsertContent("rbxasset://Fonts//Health2012.rbxm"); end pcall(function() game.Close:connect(function() NetworkServer:Stop(); end) end); NetworkServer.IncommingConnection:connect(IncommingConnection); @@ -531,6 +533,8 @@ function CSSolo(UserID,PlayerName,Hat1ID,Hat2ID,Hat3ID,HeadColorID,TorsoColorID, game.Workspace:InsertContent("rbxasset://Fonts//Health2010.rbxm"); elseif (rbxlegacyversion == "delta") then game.Workspace:InsertContent("rbxasset://Fonts//Health2011.rbxm"); + elseif (rbxlegacyversion == "omega") then + game.Workspace:InsertContent("rbxasset://Fonts//Health2012.rbxm"); end plr.Name = PlayerName; plr:LoadCharacter(); diff --git a/Health2012.rbxm b/Health2012.rbxm new file mode 100644 index 0000000..d453181 --- /dev/null +++ b/Health2012.rbxm @@ -0,0 +1,338 @@ + + null + nil + + + false + + GUI_Copy + script.HealthGUI:clone().Parent = game.StarterGui; +script:remove(); + true + + + + HealthGUI + true + + + + false + 4290164919 + 1 + 4279970357 + 1 + rbxasset://textures/healthgui/HurtOverlay.png + hurtOverlay + + 2 + 0 + 0 + -22 + + + 1 + 0 + 1.1500001 + 30 + + 0 + true + 1 + true + + + + + false + 4285215356 + 1 + 4279970357 + 1 + tray + + 0.5 + -44 + 1 + -26 + + + 0 + 170 + 0 + 18 + + 2 + 0 + true + 1 + true + + + + false + 4294967295 + 1 + 4279970357 + 1 + rbxasset://textures/healthgui/bkg.png + bkg + + 0 + 0 + 0 + 0 + + + 1 + 0 + 1 + 0 + + 0 + true + 1 + true + + + + + false + 4294967295 + 1 + 4279970357 + 1 + rbxasset://textures/healthgui/BarRed.png + barRed + + 0.0189999994 + 0 + 0.100000001 + 0 + + + 0 + 0 + 0 + 0 + + 0 + true + 1 + true + + + + + false + 4294967295 + 1.00000012 + 4279970357 + 0 + bar2 + + 0.0189999994 + 0 + 0.100000001 + 0 + + + 0.192000002 + 0 + 0.829999983 + 0 + + 0 + 0 + true + 1 + true + + + + false + + Script + h = script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid +tray = script.Parent +local lastHealth = 100 +local lastHealth2 = 100 +local maxWidth = 0.96 + +function UpdateGUI(health) + local width = (health / h.MaxHealth) * maxWidth + local height = 0.83 + local lastX = tray.bar.Position.X.Scale + local x = 0.019 + (maxWidth - width) + local y = 0.1 + + tray.bar.Position = UDim2.new(x,0,y, 0) + tray.bar.Size = UDim2.new(width, 0, height, 0) + -- If more than 1/4 health, bar = green. Else, bar = red. + if( (health / h.MaxHealth) > 0.25 ) then + tray.barRed.Size = UDim2.new(0, 0, 0, 0) + else + tray.barRed.Position = tray.bar.Position + tray.barRed.Size = tray.bar.Size + tray.bar.Size = UDim2.new(0, 0, 0, 0) + end + + if ( (lastHealth - health) > (h.MaxHealth / 10) ) then + lastHealth = health + + if h.Health ~= h.MaxHealth then + delay(0,function() + AnimateHurtOverlay() + end) + delay(0,function() + AnimateBars(x, y, lastX, height) + end) + end + else + lastHealth = health + end +end + + +function HealthChanged(health) + +end + +function AnimateBars(x, y, lastX, height) + local width = math.abs(x - lastX) + if( x > lastX ) then + x = lastX + end + tray.bar2.Position = UDim2.new(x,0, y, 0) + tray.bar2.Size = UDim2.new(width, 0, height, 0) + tray.bar2.BackgroundTransparency = 0 + local GBchannels = 1 + local j = 0.2 + + local i_total = 30 + for i=1,i_total do + -- Increment Values + if (GBchannels < 0.2) then + j = -j + end + GBchannels = GBchannels + j + if (i > (i_total - 10)) then + tray.bar2.BackgroundTransparency = tray.bar2.BackgroundTransparency + 0.1 + end + tray.bar2.BackgroundColor3 = Color3.new(1, GBchannels, GBchannels) + + wait(0.02) + end +end + +function AnimateHurtOverlay() + -- Start: + -- overlay.Position = UDim2.new(0, 0, 0, -22) + -- overlay.Size = UDim2.new(1, 0, 1.15, 30) + + -- Finish: + -- overlay.Position = UDim2.new(-2, 0, -2, -22) + -- overlay.Size = UDim2.new(4.5, 0, 4.65, 30) + + overlay = HealthGUI_prototype.hurtOverlay + overlay.Position = UDim2.new(-2, 0, -2, -22) + overlay.Size = UDim2.new(4.5, 0, 4.65, 30) + -- Animate In, fast + local i_total = 2 + local wiggle_total = 0 + local wiggle_i = 0.02 + for i=1,i_total do + overlay.Position = UDim2.new( (-2 + (2 * (i/i_total)) + wiggle_total/2), 0, (-2 + (2 * (i/i_total)) + wiggle_total/2), -22 ) + overlay.Size = UDim2.new( (4.5 - (3.5 * (i/i_total)) + wiggle_total), 0, (4.65 - (3.5 * (i/i_total)) + wiggle_total), 30 ) + wait(0.01) + end + + i_total = 30 + + wait(0.03) + + -- Animate Out, slow + for i=1,i_total do + if( math.abs(wiggle_total) > (wiggle_i * 3) ) then + wiggle_i = -wiggle_i + end + wiggle_total = wiggle_total + wiggle_i + overlay.Position = UDim2.new( (0 - (2 * (i/i_total)) + wiggle_total/2), 0, (0 - (2 * (i/i_total)) + wiggle_total/2), -22 ) + overlay.Size = UDim2.new( (1 + (3.5 * (i/i_total)) + wiggle_total), 0, (1.15 + (3.5 * (i/i_total)) + wiggle_total), 30 ) + wait(0.01) + end + + -- Hide after we're done + overlay.Position = UDim2.new(10, 0, 0, 0) +end + +h.Changed:connect(function() + UpdateGUI(health) + if ( (lastHealth2 - health) > (humanoid.MaxHealth / 10) ) then + lastHealth2 = health + else + lastHealth2 = health + end end) + + true + + + + + + false + 4294967295 + 1 + 4279970357 + 1 + rbxasset://textures/healthgui/Bar.png + bar + + 0.0189999994 + 0 + 0.100000001 + 0 + + + 0.959999979 + 0 + 0.829999983 + 0 + + 0 + true + 1 + true + + + + + false + 4294967295 + 1 + 4279970357 + 0 + rbxasset://textures/healthgui/label.png + label + + 0.680000007 + 0 + 0.300000012 + 0 + + + 0.25 + 0 + 0.349999994 + 0 + + 0 + true + 1 + true + + + + + + \ No newline at end of file diff --git a/RBXLegacySetup.iss b/RBXLegacySetup.iss index 8ee22d2..7beb2a2 100644 --- a/RBXLegacySetup.iss +++ b/RBXLegacySetup.iss @@ -1,7 +1,7 @@ ; Script generated by the Inno Script Studio Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! -#define AppVer "1.16.1" +#define AppVer "1.17" [Setup] ; NOTE: The value of AppId uniquely identifies this application.