AkaiNight Posted June 26, 2021 Share Posted June 26, 2021 I am making a hud-like pannel for my character stats like level experience boss kill etc... Well it works fine but it does not update itself when the character level ups how i can make it check for any changes? Anyway im leaving my codes. this is for my character to level up if inst.experience >= inst.expneededforlevel then inst.experience = 0 inst.SoundEmitter:PlaySound("kitsura/characters/kitsura/level up") inst.level = inst.level + 1 inst.expneededforlevel = (inst.expneededforlevel * 0 + inst.level * 10) inst.components.talker:Say("Level Up!! Level \n".. (inst.level) ) end and this is the screen shot of the menu when this photo taken my character was lvl 1(i am sure he is) and he had some experience with 1 koalefant kill but none of them were updated. i don't know how to check for if the variables are changed or not. Link to comment https://forums.kleientertainment.com/forums/topic/131267-how-to-update-variables/ Share on other sites More sharing options...
CarlZalph Posted June 27, 2021 Share Posted June 27, 2021 If the server has caverns then the player is a full client and won't see such updates. Look into networked variables to pass data from the server to a client, or use the newer mod RPC interface to pass the data. 1 Link to comment https://forums.kleientertainment.com/forums/topic/131267-how-to-update-variables/#findComment-1473561 Share on other sites More sharing options...
AkaiNight Posted June 27, 2021 Author Share Posted June 27, 2021 51 minutes ago, CarlZalph said: If the server has caverns then the player is a full client and won't see such updates. Look into networked variables to pass data from the server to a client, or use the newer mod RPC interface to pass the data. Well tbh i don't have any idea how to do that... i guess for level and other stuffs i can do it old way. (like in the stat_ui.lua i can enter some vaules depends on level so when my level changes it replaces the number etc.) but for kill count or experiences i need to find another way can't i just connect stat_ui.lua with my character.lua? is it possible? or is there any tutorials for networked variables? Link to comment https://forums.kleientertainment.com/forums/topic/131267-how-to-update-variables/#findComment-1473574 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now