Blockland Forums > Modification Help
Any tutorials for a server-sided chatbot?
jes00:
--- Quote from: YourBuddyBill on March 27, 2012, 03:25:45 PM ---I just need to figure out how to toggle it, I'll go tear up other people's mods for the specifics of most of it.
I'm relatively new to scripting, mind you, I can generally only manage simple edits.
Of course, I might be able to piece even the toggling together by using some simple variable thing, but...
Long story short, don't assume I'll magically know all the basics.
--- End quote ---
--- Code: ---function serverCmdToggleChatbot(%client)
{
if(%client.isAdmin || (%client.isSuperAdmin))
{
if($Pref::Server::ChatBot::IsOn)
{
$Pref::Server::ChatBot::IsOn = false;
announce("\c6The chatbot is now \c3OFF");
}
else
{
$Pref::Server::ChatBot::IsOn = true;
announce("\c6The chatbot is now \c3ON");
}
}
else
{
messageClient(%client, '', "You must be an admin to use this command.");
}
}
--- End code ---
Blocki:
--- Quote from: YourBuddyBill on March 27, 2012, 11:50:17 AM ---I'm trying to make a chatbot called Ted.
Among his features, if someone said "Ted" ("is my" or "'s my" or "s my") "bitch", they would be slapped with the message Ted has slapped (playername)!
--- End quote ---
Easy thinking, you could do sonething like this
--- Code: ---case "Teds my bitch"
announce("\c6Ted has slapped \c4" @ %client @ " \c6in the face!");
findclientbyname(%client).player.addvelocity("5 5 20");
return;
--- End code ---
Idk how you get %client
Idk how to hurt the player
Swollow:
--- Quote from: Blocki on March 27, 2012, 05:37:14 PM ---Easy thinking, you could do sonething like this
--- Code: ---case "Teds my bitch"
announce("\c6Ted has slapped \c4" @ %client @ " \c6in the face!");
findclientbyname(%client).player.addvelocity("5 5 20");
return;
--- End code ---
Idk how you get %client
Idk how to hurt the player
--- End quote ---
--- Code: ---%Client.player.addvelocity("5 5 20");
%Client.player.addhealth(-10);
--- End code ---