Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.42 KB | None | 0 0
  1. wait(1)
  2.  
  3. local damage = {}
  4.  
  5.  
  6. function damage.Ready()
  7.     game:WaitForChild("ServerStorage")
  8.     local dmgbil = Instance.new("BillboardGui")
  9.     dmgbil.Parent = game.ServerStorage
  10.     dmgbil.Name = "damageind"
  11.     dmgbil.Size = UDim2.new(5,10,1,2)
  12.     dmgbil.Active = true
  13.     dmgbil.AlwaysOnTop = true
  14.     dmgbil.Enabled = true
  15.     local dmglabel = Instance.new("TextLabel")
  16.     dmglabel.BackgroundTransparency = 1
  17.     dmglabel.BackgroundColor3 = Color3.fromRGB(255,255,255)
  18.     dmglabel.TextColor3 = Color3.fromRGB(255,255,255)
  19.     dmglabel.TextScaled = true
  20.     dmglabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
  21.     dmglabel.TextStrokeTransparency = 0.4
  22.     dmglabel.Size = UDim2.new(1,0,1,0)
  23.     dmglabel.Parent = dmgbil
  24.    
  25.     local healbil = Instance.new("BillboardGui")
  26.     healbil.Parent = game.ServerStorage
  27.     healbil.Name = "healind"
  28.     healbil.Size = UDim2.new(5,10,1,2)
  29.     healbil.Active = true
  30.     healbil.AlwaysOnTop = true
  31.     healbil.Enabled = true
  32.     local heallabel = Instance.new("TextLabel")
  33.     heallabel.BackgroundTransparency = 1
  34.     heallabel.BackgroundColor3 = Color3.fromRGB(255,255,255)
  35.     heallabel.TextColor3 = Color3.fromRGB(0,255,0)
  36.     heallabel.TextScaled = true
  37.     heallabel.TextStrokeColor3 = Color3.fromRGB(0,0,0)
  38.     heallabel.TextStrokeTransparency = 0.4
  39.     heallabel.Size = UDim2.new(1,0,1,0)
  40.     heallabel.Parent = healbil
  41. end
  42.  
  43. function damage.DealDamage(model, amount)
  44.     game:WaitForChild("ServerStorage")
  45.     model.Humanoid:TakeDamage(amount)
  46.     local bbg = game.ServerStorage.damageind:Clone()
  47.     bbg.ExtentsOffset = Vector3.new(math.random(-2,2), math.random(-2,2), math.random(-2,2))
  48.     local text = bbg.TextLabel
  49.     text.Text = math.floor(amount + 0.5)
  50.     bbg.Parent = model.PrimaryPart
  51.     game:GetService("Debris"):AddItem(bbg,0.7)
  52.     game:GetService("TweenService"):Create(bbg, TweenInfo.new(1.5), {ExtentsOffset = Vector3.new(bbg.ExtentsOffset.X,5,bbg.ExtentsOffset.Z)}):Play()
  53.     end
  54.  
  55.  
  56. function damage.HealDamage(model, amount)
  57.     wait()
  58.     game:WaitForChild("ServerStorage")
  59.     model.Humanoid.Health = model.Humanoid.Health + amount
  60.     local bbg = game.ServerStorage.healind:Clone()
  61.     bbg.ExtentsOffset = Vector3.new(math.random(-2,2), math.random(-2,2), math.random(-2,2))
  62.     local text = bbg.TextLabel
  63.     text.Text = math.floor(amount + 0.5)
  64.     bbg.Parent = model.PrimaryPart
  65.     game:GetService("Debris"):AddItem(bbg,2)
  66.     game:GetService("TweenService"):Create(bbg, TweenInfo.new(1.5), {ExtentsOffset = Vector3.new(bbg.ExtentsOffset.X,5,bbg.ExtentsOffset.Z)}):Play()
  67. end
  68. return damage
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement