Quote:
Originally Posted by r3ckless
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...
script..
|
It´s not the securest one. You should look around for more secure ways. Anyway this should work:
PHP Code:
// NPC made by Stowen
function onCreated(){
blockagain();
setshape(1,32,32);
}
function onActionGrab() {
clientr.hat3 = 1;
clientr.hats.add("hat3.png");
player.chat = "You received the Western Hat!";
}
//#CLIENTSIDE
function onPlayerEnters() {
if (!clientr.hat3) {
setimgpart("hat3.png", 96, 0, 48, 48);
}
else
hide();
}
function onCreated() {
if (!clientr.hat3) {
blockagain();
setshape(1,32,32);
}
else dontblock();
}