Lua
-----------------------------------------------------------
--#######################################################--
--#####################KRISCHKROS########################--
--#######################################################--
-----------------------------------------------------------
local TEMP_COLOR_R = 255
local REVERSE_COLOR_ANIMATION = true
addEventHandler("onClientRender", getRootElement(), function()
local CURRENT_PLAYER_HEALTH = getElementHealth(getLocalPlayer())
local SCREEN_W, SCREEN_H = guiGetScreenSize()
dxDrawRectangle((SCREEN_W*0.9)-(CURRENT_PLAYER_HEALTH/2)+1, (SCREEN_W*0.2)-7.5+1, 100, 15, tocolor(50,50,50))
if CURRENT_PLAYER_HEALTH > 80 then
dxDrawRectangle((SCREEN_W*0.9)-(CURRENT_PLAYER_HEALTH/2), (SCREEN_W*0.2)-7.5, CURRENT_PLAYER_HEALTH, 15, tocolor(255,0,0))
dxDrawText("HP: "..math.floor(CURRENT_PLAYER_HEALTH).."%", (SCREEN_W*0.9)-(CURRENT_PLAYER_HEALTH/2)+(dxGetTextWidth("HP: "..math.floor(CURRENT_PLAYER_HEALTH).."%")/2), (SCREEN_W*0.2)-7, CURRENT_PLAYER_HEALTH, 15, tocolor(255,255,255))
end
if CURRENT_PLAYER_HEALTH <= 15 then
if REVERSE_COLOR_ANIMATION then
TEMP_COLOR_R = TEMP_COLOR_R - 1
if TEMP_COLOR_R == 1 then
REVERSE_COLOR_ANIMATION = false
end
else
TEMP_COLOR_R = TEMP_COLOR_R + 1
if TEMP_COLOR_R == 255 then
REVERSE_COLOR_ANIMATION = true
end
end
local R, G, B = 255, math.random(100, 255), 0
dxDrawRectangle((SCREEN_W*0.9)-(CURRENT_PLAYER_HEALTH/2), (SCREEN_W*0.2)-7.5, CURRENT_PLAYER_HEALTH, 15, tocolor(TEMP_COLOR_R, 255-TEMP_COLOR_R, B))
dxDrawText("HP: "..math.floor(CURRENT_PLAYER_HEALTH).."%", (SCREEN_W*0.9)-(CURRENT_PLAYER_HEALTH/2)+(dxGetTextWidth("HP: "..math.floor(CURRENT_PLAYER_HEALTH).."%")/2), (SCREEN_W*0.2)-7, CURRENT_PLAYER_HEALTH, 15, tocolor(255,255,255))
end
if CURRENT_PLAYER_HEALTH <= 5 then
local R, G, B = math.random(100, 255), math.random(100, 255), 0
dxDrawRectangle((SCREEN_W*0.9)-(CURRENT_PLAYER_HEALTH/2), (SCREEN_W*0.2)-7.5, CURRENT_PLAYER_HEALTH, 15, tocolor(R, G, B))
dxDrawText("HP: "..math.floor(CURRENT_PLAYER_HEALTH).."%", (SCREEN_W*0.9)-(CURRENT_PLAYER_HEALTH/2)+(dxGetTextWidth("HP: "..math.floor(CURRENT_PLAYER_HEALTH).."%")/2), (SCREEN_W*0.2)-7, CURRENT_PLAYER_HEALTH, 15, tocolor(255,255,255))
end
end)
-----------------------------------------------------------
--#######################################################--
--######################VIEL SPAß########################--
--#######################################################--
-----------------------------------------------------------
Alles anzeigen
Ich habe das für einen Scripter gemacht, aber ich möchte ungern, das ich ihn wieder einfach lösche, stattdessen stelle ich es hier Copy&Pastern zur Verfügung.
Der Script ist sehr einfach, aber für ein Anfänger wäre das Optimal!
Falls ein Moderator/Admin/Super Mod das hier ließt und sagt, falsche Kategorie, würde ich daraufhin antworten, das ich es nicht wusste, wohin ich das tuen sollte!