Jump to content

Q pictures


Quwer

Recommended Posts

I'm weak in lua.Try my words:

How do a simple script who create images on screen it was be changed with player health.

-Player hp = 200 (standard max health) images 1

-Player hp = 170 images 2

-Player hp = 140 images 3

-Player hp = 120 images 4

-Player hp = 90....

When he die images 7 :roll:

did you understoond ?

Link to comment

i got his idea.

addEventHandler("onClientPedDamage", getLocalPlayer(), function()
local hp = getElementHealth(source)
if (hp >= 170) then
-- change to and create image 1 (full hp)
elseif (hp < 170 and >= 140) then
-- image 2
elseif (hp < 140 and >= 110) then
-- image 3
elseif (hp < 110 and >= 80) then
-- image 4
elseif (hp < 80 and >= 50) then
-- image 5
elseif (hp < 50 and >= 20) then
-- image 6
elseif (hp < 20) then
-- almost dying player image
end
end)
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), function()
-- change to full HP image
end)
addEventHandler("onClientPedWasted", getLocalPlayer(), function()
-- change to dead player image
end)

for creating images use:
my_image = guiCreateStaticImage(arguments,goes,here,...)
for changing image use:
guiStaticImageLoadImage(check_wiki,to_see_arguments_list)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...