Hi, I’m looking to make a health system similar to ones in games like Super Mario Galaxy, A Hat in Time, etc., but I have little experience in scripting and have no idea where to start.
Here’s basically what I think I need to do:
I need the script to identify how much health the player has through humanoid.health.
If the player has full health, display the image that shows full health. If 75%, show image for 75, etc
Start with a server script and assign each player a health value.
local Health = {}
-- then when a player joins:
Health[Player.Name] = {Health = 4} -- default value
-- when a player takes damage
Health[Player.Name].Health = Health[Player.Name].Health -1
-- do a check to see if the player should be dead
--Send to client with a number so that you can update their UI accordingly.
Much nicer method, I only started doing my server only method because I noticed giving exploiters too much information about other players can result in bad things.
For example: Exploiter does a loop and checks who is on 1 health and instantly teleports and kills them. Just an example.
I don’t think you read this post right. They were talking about Intvalues, and tables to store health, Not actully health in a humanoid. And that these values would be stored in the server, and not the client, making them slightly harder for exploiters, (Not impossible, just harder).
Also, try not to revive posts that are a couple of years old, as some methods of exploiting (for your case, have changed since 2020)