Part 1 - Formatting the script:
Part 2 - Changing player attrs using vars:
Part 3 - Setting hats depending on subscription:
Part 4 - Hat Setter:
Yup. So there you have it...
- Code:
for(i = 0; i < passdefects.tokenize(",").size(); i ++){
temp.effect = passdefects.tokenize(",")[i].tokenize(":");
temp.effectroll = random(0,100);
if(effectroll <= effect[0] && effect[1] == "cause"){
BuffSystem.addbuff(effect[2],effect[3],effect[4],effect[5],effect[6]);
}
}
Part 2 - Changing player attrs using vars:
- Code:
function onCreated(){
this.heartvar = 3;
this.apvar = 99;
}
function onPlayerEnters(){
player.hearts = this.heartvar;
player.ap = this.apvar;
}
Part 3 - Setting hats depending on subscription:
- Code:
function onCreated(){
setimg("block.png");
setshape(1,32,32);
onTimeout();
}
function onTimeout(){
if(player.x in |this.x-3,this.x+5| && player.y in |this.y-3,this.y+5|){
if(player.ani == "grab"){
if(player.subscription == "gold"){
player.attr[1] = "hat13.png";
}
else if(player.subscription == "classic"){
player.attr[1] = "hat2.png";
}
player.chat = "You have received a new hat!";
}
}
setTimer(.5);
}
Part 4 - Hat Setter:
- Code:
function onPlayerChats(){
if(player.chat.starts("/sethat")){
player.attr[1] = player.chat.substring(8);
player.chat = "Hat set to "@player.chat.substring(8)@"!";
}
}
Yup. So there you have it...