I already made a leveling system.It's a screen gui type of leveling systems but the thing is i can't make it so if a person levels up that certain person gains 10 more max health.Please help me!
How can i make it so if a person levels up that certain person gains 10 more max health?
1 answer
You can use something like this :
if game.Players.LocalPlayer.Data.Level + 1 then
game.Players.LocalPlayer.Character.Humanoid.MaxHealth = game.Players.LocalPlayer.Character.Humanoid.MaxHealth + 10
end
Please comment if i did something wrong. Also don't forget to accept if it worked!
13 comments
It doesn't work this way.I have to ask u something though.Where should i put it,when i added it into the gui it didn't work have any extra ideas?
You mean like where to put the script? Try explaining more about what you mean
Yep exactly as u said i have no idea where to put that script im quite new at scripting.
Oh, is the game filtering enabled? If not, you can put that script in the workspace and make sure the Folder with all the stat's is duplicated into the player
it is filtering enabled so what should i do now? Should i disable filtering enabled or..?
If you enabled filtering enabled, you will need to use RemoteEvents or RemoteFunctions for the server to communicated to the player, and player to communicate to the server. It's only need if you want your game to not be exploitable by hackers, etc. If it is, or not, just make a script in the ServerScriptService and make it so when the player joins it duplicates a folder with all the data values
Thanks a lot! There is only 1 more thing. How can i make those health gains save like levels do?
You can use a DataStore script to save a value in the player's data, and make that value the player's health. That's how i do it though, it's easier for me.
For example: if the data value is 120, then make a script saying if the value is 120 then the player's maxhealth is 120
Thanks a lot mate! I will tell u if it works or not later i have to do something now thanks again!
Np, glad to help!, and please accept the answer.
You can always add a number to a number..............
rest in poop... no rep xD
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
If you can make an entire leveling system but can't make it add 10 health when they level up then I don't know what to say.
LOL!!! gud point ^^^^^^^^^^^