You can probably try and block people that make mirrors of your mods, I know there is a function where you can get a players name (probably something like Player.getName()) so just check if that's the players name and if it is block the script.
Example:
var load = false;
var bp = ["Lambo_car16","TehEnderman"];//these are just examples, dont make the variable name too obvious
function selectLevelHook(){
for(var i=0;i<bp.length;i++){
if(Player.getName()!=i){//if the players name isnt in the list
load=true;//make the load variable true
}else load=false;
}
}
function useItem(x,y,z,item,block,side){if(load){
//do everything you would normally like too do
}}
I haven't tested the code, although I probably will and I will tell you guys if it works.
You can probably try and block people that make mirrors of your mods, I know there is a function where you can get a players name (probably something like Player.getName()) so just check if that's the players name and if it is block the script.
Example:
var load = false;
var bp = ["Lambo_car16","TehEnderman"];//these are just examples, dont make the variable name too obvious
function selectLevelHook(){
for(var i=0;i<bp.length;i++){
if(Player.getName()!=i){//if the players name isnt in the list
load=true;//make the load variable true
}else load=false;
}
}
function useItem(x,y,z,item,block,side){if(load){
//do everything you would normally like too do
}}
I haven't tested the code, although I probably will and I will tell you guys if it works.
This does not work, and I'm not sure why. I think it's because of the Player.getName(). I'm gonna test something like this in HTML later.Wait... I'm being really dumb... it should be
var load=false;
var bp=["Lambo_car16","TehEnderman"];
function newLevel(){
if(bp.indexOf(Player.getName(Player.getEntity()))<0){
load=true;
}
}
function useItem(x,y,z,item,block,side){if(load){
}}
function modTick(){if(load){
}}
function attackHook(attacker,victim){//same thing...
}
The problem is, these people can simply delete that code. Then they can say "its my mod".
Most people that mirror our mods probably don't know how to code. And you can just obfuscate this code then.But some people don't change there MCPE username, but this is just a example.
Why do you really need to protect? Most of these mods you can make with ease, though copyright is against the law, people are still gonna do it no matter what you do. The only way is to obfuscating.
Rather than people stealing my scripts, I think I would just prefer to make tutorials. Stealing doesn't increase your programming knowledge. Also, obfuscating is probably the best option, but the script will still not be 100% secure. As soon as anyone publicly releases an open source piece of code, they're just asking for code thiefs.
You can probably try and block people that make mirrors of your mods, I know there is a function where you can get a players name (probably something like Player.getName()) so just check if that's the players name and if it is block the script.
Example:
var load = false;
var bp = ["Lambo_car16","TehEnderman"];//these are just examples, dont make the variable name too obvious
function selectLevelHook(){
for(var i=0;i<bp.length;i++){
if(Player.getName()!=i){//if the players name isnt in the list
load=true;//make the load variable true
}else load=false;
}
}
function useItem(x,y,z,item,block,side){if(load){
//do everything you would normally like too do
}}
I haven't tested the code, although I probably will and I will tell you guys if it works.
Wait wont
Player.getName(getPlayerEnt());
Give the words of the name? Not the length. So don't you have to do this?
var load = false;
var bp = ["Lambo_car16","TehEnderman"];//these are just examples, dont make the variable name too obvious
function selectLevelHook(){
for(var i=0;i<bp.length;i++){
var name = Player.getName(getPlayerEnt()).length;
if(name !=i){//if the players name isnt in the list
load=true;//make the load variable true
}else load=false;
}
}
function useItem(x,y,z,item,block,side){if(load){
//do everything you would normally like too do
}}
Or am I just being a total idiot questioning people
Rollback Post to RevisionRollBack
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
You might be able to write the code so it checks another copy of itself online to see if any code is modified, but people would still be able to distribute unmodified copies... That would solve the problem of people taking credit, though.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumExample:
var load = false; var bp = ["Lambo_car16","TehEnderman"];//these are just examples, dont make the variable name too obvious function selectLevelHook(){ for(var i=0;i<bp.length;i++){ if(Player.getName()!=i){//if the players name isnt in the list load=true;//make the load variable true }else load=false; } } function useItem(x,y,z,item,block,side){if(load){ //do everything you would normally like too do }}I haven't tested the code, although I probably will and I will tell you guys if it works.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumPlayer.getName() has to run when you're inside a world (i.e. in newLevel)
https://developers.google.com/closure/compiler/
I used it and like it. It can run on both the command line and as a webpage - for the online version, http://closure-compiler.appspot.com/home
I will test again later.
var load=false; var bp=["Lambo_car16","TehEnderman"]; function newLevel(){ if(bp.indexOf(Player.getName(Player.getEntity()))<0){ load=true; } } function useItem(x,y,z,item,block,side){if(load){ }} function modTick(){if(load){ }} function attackHook(attacker,victim){//same thing... }Most people that mirror our mods probably don't know how to code. And you can just obfuscate this code then.But some people don't change there MCPE username, but this is just a example.
Rather than people stealing my scripts, I think I would just prefer to make tutorials. Stealing doesn't increase your programming knowledge. Also, obfuscating is probably the best option, but the script will still not be 100% secure. As soon as anyone publicly releases an open source piece of code, they're just asking for code thiefs.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Wait wont Give the words of the name? Not the length. So don't you have to do this?
var load = false; var bp = ["Lambo_car16","TehEnderman"];//these are just examples, dont make the variable name too obvious function selectLevelHook(){ for(var i=0;i<bp.length;i++){ var name = Player.getName(getPlayerEnt()).length; if(name !=i){//if the players name isnt in the list load=true;//make the load variable true }else load=false; } } function useItem(x,y,z,item,block,side){if(load){ //do everything you would normally like too do }}Or am I just being a total idiot questioning people
IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->