What do I want to achieve?
I want to make it so when a player picks a certain class (in this case; Tank) their maxhealth is increased so that when they take damage they can take more hits til they die.
What is the issue?
Whenever the player takes damage (after having selected the class) their new max health value gets ignored, setting it to 100.
What solutions have I tried so far? Did you look for solutions on the Developer Hub?
I’ve tried looking on resources like youtube, but haven’t found much help. I’ve also looked at similar posts on the forums.
Here’s a function I made to give the player stats for the Tank class, everything else works besides the Health / MaxHealth. Just wondering, seeing as I’m fairly new to scripting, if I missing something.
from the look of things you are changing the max health via the client, you have to change it via the server cause thats where damage should be handled, also changing it on the client means no other players can see that change, and again the server cant either
Okay, ill give it a try. Might have to rearrange some things for it to work, but shouldn’t be too bad. I’m just messing around testing currently for a system I plan to implement. Thanks for the help! The local script is in startcharacter scripts, can I put a server script here?
I think it’s working now! Tysm for the help, what I did was fire a new event called TankHealth from the local script shown instead of changing the humanoid values there. Then I made a script in ServerScriptService (TankHealthScript) where I then changed the values of the humanoid. I tested it out on an attacking dummy and it works! Thanks for helping! This also explains why some of my other scripts dont work Have a good one!