Author Topic: Jesus Mod  (Read 12370 times)



Commands:
  • (Admin) /makeJesus <name> - Makes this person Jesus. There can only be one.
  • (Admin) /crucify <name> - Kills this person. This can be Jesus.
  • (Jesus) /toHell - Teleports whoever Jesus is looking at to the farlands.

Features:
  • Jesus can walk on water.
  • Jesus requires wheelchair access in order to escape said water.
  • Jesus wears cool robes.

This stuff helps to make it not suck:
  • Hatmod, download here
  • Blockland Glass, download here
    Prefs:
    • Clothes - Toggles Jesus' attire
    • /toHell - Toggles Jesus' ability to kill

Download
Blockland Glass

This isn't a player-type so it's notably buggy.
« Last Edit: August 17, 2017, 11:37:06 AM by Moosh »


jesus christ it's jesus christ


The Bible Series: Now in Blockland


Bibleland, that game where you pray for stuff.

The crucification function is particularily strange.

Code: [Select]
function serverCmdCrucify(%client,%user) {
%crucify = findClientByName(%user);
if(%client.isAdmin) {
if(isObject(%crucify)) {
for(%a = 0; %a <= clientGroup.getCount()-1; %a++) {
%member = clientGroup.getObject(%a);
if(%member == %crucify) {
%member.isJesus = false;
%member.player.kill();
}
}
messageAll('', "\c6" @ %crucify.name @ " has been \c3crucified\c6!");
} else {
messageClient(%client, '', "\c6This \c3Jesus\c6 does not exist!");
}
} else {
messageClient(%client, '', "\c6You do not have perission to \c3summon Jesus\c6.");
}
}

So this function goes through all clients pointlessly until it finds its target, and then crucifies them. This doesn't have to be Jesus, though it will say this Jesus doesn't exist anyway. If you type the wrong name, then "You do not have perission to summon Jesus."

I can understand the newbie mistake in there, but it seems you copy-pasted the function above it without checking for errors or things you didn't have to do.

Here is the fixed version of this function, with comments:

Code: [Select]
function serverCmdCrucify(%client,%user) {
if(%client.isAdmin) {
%crucify = findClientByName(%user); //Don't bother looking for the target if %client isn't admin
if(isObject(%crucify))
{
//if(%crucify.isJesus) //Uncomment this line if you want only Jesuses to be crucified, otherwise remove
//No need to scan all the clients; We did findClientByName, we have our target right here
%crucify.isJesus = false;
%crucify.player.kill();
messageAll('', "\c6" @ %crucify.name @ " has been \c3crucified\c6!");
//} //Same as above commented line
}
else
{
messageClient(%client, '', "\c6This \c3person\c6 does not exist!"); //It's not always a Jesus
}
} else {
messageClient(%client, '', "\c6You do not have permission to \c3crucify\c6."); //Fixed spelling error and what you can't do
}
}

Also, when Jesus dies, it says "Jesus has been died!" Your English teacher would serve you a beating with a whip if they ever read that.

P.S. Also, I managed to download the version of the addon where /tohell was absent. This probably doesn't matter.
« Last Edit: August 15, 2017, 01:52:20 PM by Marios »

« Last Edit: August 15, 2017, 02:02:16 PM by IdeTheBird »


So this function goes through all clients pointlessly until it finds its target, and then crucifies them. This doesn't have to be Jesus, though it will say this Jesus doesn't exist anyway. If you type the wrong name, then "You do not have perission to summon Jesus."

I can understand the newbie mistake in there, but it seems you copy-pasted the function above it without checking for errors or things you didn't have to do.
Regarding the pointless cycling through all users, that's just a bad habit of mine since working on a couple other GameModes where I haven't been able to use findClientByName, and I'll update that.
I'm not really sure what you mean with the wrong name, as that message is attached to the isAdmin check.
Believe it or not, this part of the code isn't copy-pasted, the only code which has been modified from another script is the /toHell where I changed an RP script for finding who they're looking at.

I'll admit it was a bit rushed, for the most part I just wanted to get the 'walking on water' out.


shhh he's here dont say his name in vain
its too late, he's being sent to hell as we speak

I'm not really sure what you mean with the wrong name, as that message is attached to the isAdmin check.

Yes, I mean if the name you type isn't found.

Yes, I mean if the name you type isn't found.
Code: [Select]
if(%client.isAdmin) {
//
} else {
messageClient(%client, '', "\c6You do not have permission to \c3crucify\c6."); //Fixed spelling error and what you can't do
}
Only if they're not an admin will it tell them that they don't have permission.

Code: [Select]
if(isObject(%crucify)) {
//
} else {
messageClient(%client, '', "\c6This \c3Jesus\c6 does not exist!");
}
If they type a user that doesn't exist, this is the message that is supplied.

I'm not really sure what you mean is wrong with this code.