Monkuar Posted January 19, 2015 Share Posted January 19, 2015 (edited) I have a javascript code that displays a monster hitting my character via client side only. It runs every 2 seconds via a setTimeout function. My problem is... A user could just disable javascript all together, or craft their own code to disable the monster attack function. I want to detect serverside if anything is being altered. If that makes sense. This is EXTREMELY hard for me to explain, I have no idea but my game is essentially turn based at this point. THE MONSTER ONLY DOES DMG if a player HITS IT. That way, I can safely, and change the values serverside with MYSQL. What I want is the monster to attack the player every 2 seconds or so (Which I have javascript code for already), but a user could just manipulate that code and then attack the mob and receive only that damage. I want it to be more of an action attack game, where the monster's attack automatically, but securely... If that makes sense, any idea? Would I have to implement some type of timing mechanism or something serverside? Or once the player spawned that mob..? Not sure. (You only have XX Seconds to kill!), but that doesn't really fix the problem.. TLDR: Autoattack mob system serverside. Edited January 19, 2015 by Monkuar Quote Link to comment https://forums.phpfreaks.com/topic/294061-mob-attack-artificial-intelligence-server-side/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.