Hello! I'm trying to make a mining system
and I ran into an issue. I want it to put all the rocks back to normal (from being destroyed - to how they were before the player 'hurt' them) if there are no players around the rocks.
This is what I have so far for that part of the script. keep in mind I am just testing the X and Y of the player so I can go from there.
PHP Code:
function onTimeOut() {
for (pl : allplayers) {
if (pl.x + 1.5 in |this.x, this.x + 2|) {
onTrueX();
}else onFalse();
if (pl.y + 1.5 in |this.y, this.y + 2|) {
onTrueY();
}else onFalse();
}
setTimer(.05);
}
function onTrueX() this.chat = "true X";
function onTrueY() this.chat = "true Y";
function onFalse() {
this.chat = " ";
}
NOTE: This is within a class, serverside.