Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Created by Graal2007722
- function onCreated() {
- this.chat = "NPC flags";
- }
- /*
- There are certain built in flags an NPC can posses. To have
- effect they must be declared inside a function. Here are some
- of the most common ones:
- - dontblock();
- This attribute makes it so that the npc can be walked over
- by players.
- - blockagain();
- Only functions if the npc previously had the dontblock();
- attribute. This attribute makes the NPC a solid that cant
- be walked over by players.
- - drawunderplayer();
- This attribute draws the npc under the player. This is useful
- for things like chairs or rugs for example.
- - drawoverplayer();
- This attribute draws the NPC over the player. This is useful for
- lights where the object in question NEEDS to appear to be over
- the player.
- - hide();
- This attribute hides the NPC so that it cant be touched or shown.
- this can be useful for things like doors which would disappear
- once the player touchs it to be allowed through.
- - show();
- This attribute shows the NPC if it is hidden.
- - destroy();
- This attribute destroys the npc. It cannot be brought back using
- show(). The level must be updated for the NPC to be brought back.
- No script will run whilst the NPC is destroyed.
- - sleep(float/int);
- This attributes pauses the entire script of the NPC for the amount
- of time specified on the first parameter. The amount of time is
- measured in seconds. Once the amount of seconds is over the script
- continues where it left off.
- */
- function onPlayerChats() {
- switch (player.chat) {
- case "dontblock":
- dontblock();
- break;
- case "block":
- blockagain();
- break;
- case "hide":
- hide();
- break;
- case "show":
- show();
- break;
- case "drawover":
- drawoverplayer();
- break;
- case "drawunder":
- drawunderplayer();
- break;
- case "destroy":
- destroy();
- break;
- case "sleep":
- this.chat = "Im going to sleep for 3 seconds";
- sleep(3);
- this.chat = "done!";
- sleep(3);
- onCreated();
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment