need help [system]
#1

how can i make thirst system, like the player take steps then the thirst level should go automatically down i know i can done this with timer but i want to do this without timer if i can .
Reply
#2

The question is you know how to do it with a timer ?
Cause, i think you are here just because you hope somebody will do this for you, and.. literally that's not a good idea.
I don't think so there's another solution just with a timer. It's the fastest way to make this system and it's not hard at all.
Reply
#3

I guess you could try adding it into OnPlayerUpdate.
Maybe setting a variable to know when was the last update and only updating if a second has passed or whatever. Not sure if this is effective and worth the resources and could also work in unexpected ways since it triggers a different amount of times, depending on what the player is doing.

Other than that, you could go all around your gamemode and add an increase in thirst every time the player does something that would make him thirsty, like doing an animation or whatever.
Reply
#4

Quote:
Originally Posted by AdamsLT
Посмотреть сообщение
I guess you could try adding it into OnPlayerUpdate.
Maybe setting a variable to know when was the last update and only updating if a second has passed or whatever. Not sure if this is effective and worth the resources and could also work in unexpected ways since it triggers a different amount of times, depending on what the player is doing.

Other than that, you could go all around your gamemode and add an increase in thirst every time the player does something that would make him thirsty, like doing an animation or whatever.
as somebody said me always be away from timers tahts why i dont want timer in my script
Reply
#5

Yea well using timers it's not something bad. Using "OnPlayerUpdate" like a timer it is something really bad. Because your server can freeze, i had this problem in past because i used OnPlayerUpdate for all "timer" or how to say it for all that players must update into a normal timer i used with "OnPlayerUpdate". And my advice is to use the timers if you want to do this system, because from my opinion if you do everything right, nothing can go wrong.
Reply
#6

Quote:
Originally Posted by BulletRaja
Посмотреть сообщение
as somebody said me always be away from timers tahts why i dont want timer in my script
There's nothing wrong with correctly using timers, that's something for sure. It depends on the interval, anything that's not called very frequently is and should be fine.
Reply
#7

thanks all my thirst system is ready with timer for my dayz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)