Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is it possible to have a Armor Gui Bar and Armor ?

Ok so i was thinking of making a Armor gui bar and Armor for my gamemode i am working on. It would act as like the health bar would. But instead all the Armor has to be gone before the health would start going down; Or maybe it would reduce damage. please help?

2 comments

0

I can't exactly tell you how you would go about doing it but i'm sure it can be done the same way stamina and mana bars can be added to the game so explore a bit around the wiki to find out how you would do it

0

No requests on this... You haven't shown any effort at all at attempting this code.

1 answer

What if you make it when the player is wearing the armour their health is increase by 100. So now they get that "Armour" you are looking for, but in your GUI script it so that until the players health is less than 100 to not move.

Same goes for the armour, do a while (I'm am a beginner with LUA but I have coding experience). I'll make it in pseudo code (What programs write out before they code)

Store players health in a variable called health

while health is less than or equal to 200 and more than or equal to 101 
	change the armour GUI
end while

In C# I could put this in the same code but I assume you cannot since nothing will run under the while since it is a loop

Store players health again

while health is less than or equal to 100 and more than or equal to 1
	change health GUI
end while

With this, It gives the player the sense they have armour but really they are just given more health. If you wanted you could also recharge health and armour.

Store player health as playerHealth

if playerHealth hasn't changed for 10 seconds
	repeat **playerHealth = playerHealth + 10 wait(0.5) until playerHealth is equal to 200
end if

I hope this helped any. Like I sad I am still learning LUA but I am talented in C# and C++

2 comments

0

I am new to scripting . But that would work i guess..

0

If you are new i would try to get sample code, I would make you some but I am learning myself

This discussion is preserved as it was. New answers, comments, and votes are closed.