How do you create invincibility frames?

How do games like Your Bizarre Adventure make iframes? I am trying to make iframes for a fighting game I am making and I would like to know what the best solution that is efficient and not very exploitable. How could I do this?

1 Like

With CollectionService you can add tags to humanoids. Tags can only be editted from the Server so the exploiter cannot change the tags on a certain humanoid. Like maybe a tag like: “iFrame”

1 Like

But what would be the best way to do the invincibility part? Setting the health to math.huge? Using HealtChanged?

When the player gets hit, you could check if the humanoid has the iframe tag. If it does, don’t deal damage.

7 Likes

Thanks. I don’t know why I didn’t think of that!
(its literally 2:53 am help)

Sorry for the late response but I think just make it so the person can’t be damaged if they have the tag, You can check that by using CollectionService:HasTag(Humanoid, TagName)

1 Like