What does a forcefield do?

Im going to attempt making a custom forcefield for players that are inside a spawn menu so they cant be killed, i will be using that new cool forcefield material with a mesh inside it for the visual appearance of the forcefield so i wont be using a regular forcefield.

So i basically need to know what a forcefield does to a character to make him invincible. Does a forcefield simply just keeps your health at 100? Or is there another way?.

According to the wiki, ForceFields block the TakeDamage() function for humanoids.

For example, if Player1 has a ForceField and you run Player1.Humanoid:TakeDamage(50), no damage would be dealt. However, if you simply run Player1.Humanoid.Health = Player1.Humanoid.Health - 50, the player will still be damaged.

Yeah thats true, would be a good idea since my weapons in the game will never do 100 dmg at once to this?

Humanoid.HealthChanged:connect(function()
Humanoid.Health = Humanoid.MaxHealth
end)

Forcefields also prevent characters from breaking up when an explosion hits.

Big tip, btw. Forcefields have a Visible property. You don’t have to emulate its behavior yourself. Just hide it and render your own effect on top.

5 Likes

Ow thank you, i didnt know that. That will help me alot since i dont need to do anything custom made then :).