I want to make an iframe for a character. Currently I’m checking if a boolValue is in the players character each time I do damage, but that seems too redundant. Is there any way I can disable the roblox script that gives a humanoid health?
Another question: How do games like Anime Battle Arena (aba) do it where you can iframe certain moves but things like gon’s awakening goes through it?
Basically, you can’t. Humanoid is a game object and it give controls to player. I recommend hide the humanoid’s health. To hide it, go to StarterPlayers then set the HealthDisplayDistance to 0.
If you are making a game with superpowers, you need to get the enemy’s attack, and if the enemy’s attack is the attack that the iframe is not working on, disable the iframe. Also, you can use bool values in server storage. Because hackers can hack boolvalues, intvalues, etc. if they are not in server storage. You can create a table and then put the players in it, that attack you. Check the people’s attack to see if they ignore the iframe and then receive damage or not.
Also, i have answered the question that you asked “Another question”. That is how it works. Basically this is how they are doing, but different techniques.
What’s redundant about it ? it does the job and doesn’t make you lag by any means, plus you would have to write code for any other method if it existed, it’s not like you can skip writing code.
Anyway for the second question it appears you’re checking for the iframes within the the player that’s receiving the damage. If so then you should make it so certain abilities add a bool value like “SkipiFrames” to the player and it checks for that as well to know whether to take damage or not. Otherwise, and this is what I would do, you can check for the iFrames bool within the ability script; To explain further, say you have 2 abilities, in the ability handler script which would preferably be in the ServerScriptService, the first ability will check for the iframes bool value while the second ability will not check and would deal the damage regardless.
I hope that answers your questions
Yeah that’s true. I just thought it was redundant because for example, if I have 10 powers with 10 skills each, every time I do damage I would have to check for an iframe value and I just thought doing it 100 times wouldn’t be the best way to go about it.
don’t worry about that, in fact although it depends on computer performance, it would take around 4 seconds to run 1 line of code 1 billion times. So really doing it 100 times would take almost no time to run.