This is a Script Framework in which you can base your script on to use custom made functions to make ModPE modding easier. Just download or use the Id and write your script on the indicated area. Make sure to NEVER delete the Variables that hold the functions.
Hope this was helpful!
//Custom Functions Framework
//By Arjay07
var split = " ";
/////////////////////
/////FUNCTIONS///////
/////////////////////
//**DO NOT DELETE**//
///**DO NOT EDIT**///
/////////////////////
var getPlayerPosition = function(){
return getPlayerX() + split + getPlayerY() + split + getPlayerZ();
}
var setPlayerPosition = function(x,y,z){
setPosition(getPlayerEnt(), x, y, z);
}
var wMessage = function (name, message){
clientMessage("[" + name + "]:" + message);
}
var handleCommand = function (command, action){
function procCmd(cmd){
var cmd=cmd.split(" ");
if(cmd[0]==command){
action;
}
}
}
//////////
//Script//
//////////
function useItem(x,y,z,itemId,blockId,side)
{
//Your Code Here
}
function attackHook(attacker, victim)
{
//Your Code Here
}
function modTick()
{
//Your Code Here
}
function getPlayerPosition();
function setPlayerPosition(x, y, z);
function wMessage(sender, message);
function handleCommand(command, action);
If you want to request a function, tell me below!
Hope this helped out!
Examples:
//getPlayerPosition
function useItem(x, y, z, item, block, side){
if(item == 280){
clientMessage(getPlayerPosition());
//Prints out the player's position
}
//setPlayerPosition
else if(item == 0){
setPlayerPosition(x,y,z);
//Sets the player position to tapped area
}
//wMessage
else if(block == 7){
wMessage(server, "You can't go down any further!");
//Prints out [server]: You can't go down any further!
}
}
function setTimer(time, action);
function broadcast(name);
function recieve(name, action);
//NOTE:
//Broadcast-
//Sends a broadcast in the script with the defined name
//Recieve-
//Recieves the indicated broadcast and and action happens
function setTimer(time, action);
function broadcast(name);
function recieve(name, action);
//NOTE:
//Broadcast-
//Sends a broadcast in the script with the defined name
//Recieve-
//Recieves the indicated broadcast and and action happens
Could you please add the below functions;
function getEnt();
function getEntX();
function getEntY();
function getEntZ();
These custom functions are basically a mixture of implemented functions stored as a variable. Nice to shorten and make code easier to handle, but you can't implement new functions
I know.
I first made it for my brother since he is new to ModPE.
Then I thought maybe release it.
And the variable are used as functions. Parameters need to be used.
This is a Script Framework in which you can base your script on to use custom made functions to make ModPE modding easier. Just download or use the Id and write your script on the indicated area. Make sure to NEVER delete the Variables that hold the functions.
Hope this was helpful!
//Custom Functions Framework //By Arjay07 var split = " "; ///////////////////// /////FUNCTIONS/////// ///////////////////// //**DO NOT DELETE**// ///**DO NOT EDIT**/// ///////////////////// var getPlayerPosition = function(){ return getPlayerX() + split + getPlayerY() + split + getPlayerZ(); } var setPlayerPosition = function(x,y,z){ setPosition(getPlayerEnt(), x, y, z); } var wMessage = function (name, message){ clientMessage("[" + name + "]:" + message); } var handleCommand = function (command, action){ function procCmd(cmd){ var cmd=cmd.split(" "); if(cmd[0]==command){ action; } } } ////////// //Script// ////////// function useItem(x,y,z,itemId,blockId,side) { //Your Code Here } function attackHook(attacker, victim) { //Your Code Here } function modTick() { //Your Code Here }ID:
7641
Download:
https://www.dropbox....om functions.js
Added Functions:
If you want to request a function, tell me below!
Hope this helped out!
Examples:
//getPlayerPosition function useItem(x, y, z, item, block, side){ if(item == 280){ clientMessage(getPlayerPosition()); //Prints out the player's position } //setPlayerPosition else if(item == 0){ setPlayerPosition(x,y,z); //Sets the player position to tapped area } //wMessage else if(block == 7){ wMessage(server, "You can't go down any further!"); //Prints out [server]: You can't go down any further! } }Already adding:
function getEnt();
function getEntX();
function getEntY();
function getEntZ();
Thanks
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
I know.
I first made it for my brother since he is new to ModPE.
Then I thought maybe release it.
And the variable are used as functions. Parameters need to be used.
I am secretly a modder, who works only for himself, seldom publishes.