Hello, I'm trying to script part of a hat system. I have the hats, the shops etc. Im now stuck on scripting free hats you can find around the world. Something similar to UN. Below is what I have, it works except for one thing...it doesn't hide after it has been received! Could somebody please give me some tips on this/point me in the right direction for this...
PHP Code:
// NPC made by Stowen
function onCreated(){
blockagain();
setshape(1,32,32);
}
function onActionGrab() {
clientr.hat3 = 1;
client.hats.add("hat3.png");
player.chat = "You received the Western Hat!";
hide;
hideimg 200;
}
//#CLIENTSIDE
function onPlayerEnters() {
if (!clientr.hat3) {
with(findimg(200)){
image = "hat3.png";
x = this.x;
y = this.y;
partx = 100;
party = 0;
parth = 40;
partw = 45;
}
}else hide;
}
function onCreated(){
blockagain();
setshape(1,32,32);
}
function Hide() {
hide;
}