-
Notifications
You must be signed in to change notification settings - Fork 0
/
notification
36 lines (35 loc) · 1.28 KB
/
notification
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
local notifications = {}
local center = (workspace.CurrentCamera.ViewportSize / 2)
local function hitmarker_update()
for i = 1, #notifications do
notifications[i].Position = Vector2.new(center.X,(center.Y + 150) + (i * 18))
end
end
local function hitmarker(Name, Distance, Damage, Duration)
task.spawn(function()
local hitlog = Drawing.new('Text')
hitlog.Size = 25
hitlog.Font = 2
hitlog.Text = " "..Name.." / "..Distance.."studs / -"..math.floor(Damage).." "
hitlog.Visible = true
hitlog.ZIndex = 3
hitlog.Center = true
hitlog.Color = Color3.fromRGB(255, 255, 255)
hitlog.Outline = true
table.insert(notifications, hitlog)
hitmarker_update()
wait(Duration)
table.remove(notifications, table.find(notifications, hitlog))
hitmarker_update()
hitlog:Remove()
end)
end
game:GetService("LogService").MessageOut:Connect(function(message)
local Name = message:match("->([%w_]+)");
local HealthBfr, HealthAfr = message:match("(%d+%.?%d*)->(%d+%.?%d*)hp");
local Dist = message:match("(%d+%.?%d*)s")
local Damage = tonumber(HealthBfr) - tonumber(HealthAfr)
if Name and HealthBfr and HealthAfr and Dist and Damage then
hitmarker(Name, Dist, Damage, 4)
end
end)