Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
minetest.register_on_player_hpchange(function(player, hp_change)
if hp_change<0 then
local name=player:get_player_name()
minetest.after(0, function(name,player)
local r,g,b=screencolor.rndhexcolor(),screencolor.rndhexcolor(),screencolor.rndhexcolor()
screencolor.user[name]=player:hud_add({
hud_elem_type = "image",
text ="screencolor_scr.png^[colorize:#" .. r .. g .. b .. "aa",
name = "rndcsc",
scale = {x=-100, y=-100},
position = {x=0, y=0},
alignment = {x=1, y=1},
})
end,name,player)
minetest.after(0.8, function(name,player)
player:hud_remove(screencolor.user[name])
screencolor.user[name]=nil
end,name,player)
end
end)
screencolor={user={}}
--screencolor.user[name] then id is stored as a global var if you want to use it to somthing
function screencolor.rndhexcolor()
local a="0123456789ABCDEF"
local a1=math.random(1,16)
local a2=math.random(1,16)
return string.sub(a,a1,a1) .. string.sub(a,a2,a2)
end
UjEdwin wrote:Like this?
it replacing the red flash effect with randomly colors[/code]
UjEdwin wrote:many things is possible in minetest, even people dont know it :-)
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)
Users browsing this forum: No registered users and 6 guests