After messing with the join command a bit I came up with this script. It’s probably been done before, but I hope you guys like it nevertheless.
My level npc:
// NPC made by traddles
if (created || playerenters) {
timereverywhere;
setimg arrowsbox.png;
setstring this.name,arrowbox;
join persistentdraggable;
init();
}
function onDragStop() {
// just here to demonstrate the ability
// to do stuff on being dropped by a player
if (x > 62) x = 62;
if (y > 62) y = 62;
if (x < 0) x = 0;
if (y < 0) y = 0;
say2 I've been dropped;
}
Attached is the persistentdraggable.txt file. In order to use this npc you need to do at a minimum:
if (created || playerenters) {
<either a setimg or a setshape>
setstring this.name,<some_unique_name>;
join persistentdraggable;
init();
}
Although I also made the persistentdraggable.txt npc call “onDragStop()” so if you write a function with that name it will get called when a player stops dragging the npc. Or you can not write the function and the script just stops dragging the npc. (in my example I use the onDragStop() function to check for the npc being off the level and also a say2).
I’ve attached a level and the npc text file. Or if you want to see it in action but don’t feel like adding these files to your server I’ve got a demo up on my still-in-progress server “selzvati”.
oops. Sorry. Didn’t realize there was a script showcase subforum to the npc subforum. Thanks for moving it.
Also, it occurred to me about 10 minutes after posting that this doesn’t handle crossing levels in an overworld. I’ll have to work on that for the next iteration.
interesting script… but just add it to weapons and u could make a… RETARDED ADMIN WEAPON!!! YAY! hmmmm maybe that would be cool… it depends. well its pretty fun i guess… ok im doing that i guess i would be an abusive staff. I’d drag noobs on roofs and force them to buy i membership:) that would be fun ( IM SORRY I DIDNT MEAN IT DONT FIRE ME!!!)
[QUOTE=awsome4478;68009]interesting script… but just add it to weapons and u could make a… RETARDED ADMIN WEAPON!!! YAY! hmmmm maybe that would be cool… it depends. well its pretty fun i guess… ok im doing that i guess i would be an abusive staff. I’d drag noobs on roofs and force them to buy i membership:) that would be fun ( IM SORRY I DIDNT MEAN IT DONT FIRE ME!!!)[/QUOTE]
My lil brother plays igraal and he was watching me on the comp when i was home for spring break and he said “hey tricxta he made a room in ipod in a nightclub”, is that you
[QUOTE=awsome4478;68034]I posted it bcuz…IDK GET OFF MY CHIZ ( WHAT IS CHIZ?!?) I MEAN IM SORRY FOR SHARING MY LIVES STORY WITH U I MEAN WHY??? !pissed![/QUOTE]
[QUOTE=Traddles;67687]
oops. Sorry. Didn’t realize there was a script showcase subforum to the npc subforum. Thanks for moving it.
Also, it occurred to me about 10 minutes after posting that this doesn’t handle crossing levels in an overworld. I’ll have to work on that for the next iteration.
[/QUOTE]