![]() |
Help with image part and gani.
Hello,
I'm trying to make a health bar show up when you have a certain amount of health and change sizes above your head according to the amount of health you have. Currently, showing the image above the players head works and shows for everyone supprisingly (it's placed in a gani and triggered with a weapon). Though the issue I have is, the image part changes locally.. I really need it to show for everybody because it would be useless if it couldn't. Here is the weapon I currently have: PHP Code:
PHP Code:
-Ohk4y |
What's actually happening is that the script is being run on every player's computer since it's in a GANI script. The problem is that you can't access other players' clientr variables. You should put the health into another player.attr[] and use that instead of a clientr variable in the GANI.
Also, you don't need a timeout in your GANI. Try showing on onPlayerEnters and onCreated, and just set img.attachToOwner = true. |
Quote:
PHP Code:
|
You have a period at the end of the attachToOwner instead of a semicolon, and you didn't change the clientr. variable near the hideImg. You also need to use a separate attr index for the maximum health value.
|
Quote:
PHP Code:
|
Quote:
PHP Code:
It's easier just use a Weapon-NPC and draw the HP bars over everyone's head instead of using an attr to display it. I.e: PHP Code:
You can remove and re-add the attr everytime their health changes. I.e: PHP Code:
|
Quote:
PHP Code:
|
If you have an index < 200 I believe the GUI will show for 'every' player. I remember because I was having a similar problem before.
|
I thought it was less then 250 that shows serverside :S
|
Quote:
|
Quote:
|
All times are GMT +2. The time now is 04:27 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.