![]() |
Slideing door
Okay I need a "Kingdome door" When someone has a TAG and the say "Open gate" it slides open and when they say "Close Gate" It slides closed.
|
NPC Code: well I guess it would probably make it a shorter code if I would have took what is in the functions and like put it in were it calls it but oh well to lazy to do that now (I am pretty sure htis iwll work for an npc server).. this will make the npc move back and forth 5 tiles (left and right) |
Will it work offline? And what about the Kingdome/guild TAG part?
|
NPC Code: this one is a lot better then the other one lol (the other one it wouldn't smoothly go over it would just appear there lol so I added a sleep, took out the functions, and made it so they can only open the door if the door is closed) yes it does work offline... (and pretty sure it works online all the functions look like they will work online)... only thing you have to edit is the guild name in red |
wow KJL u r good scripter
|
Code
if(playerchats&&strequals(#g,GUILDNAME)){
if(strequals(#c,open door)&&this.open==0){ for (this.moved=0;this.moved<10;this.moved++){ x-=0.5; sleep 0.1; } this.open=1; }elseif(strequals(#c,close door)&&this.open==1){ for (this.moved=0;this.moved<10;this.moved++){ x+=0.5; sleep 0.1; } this.open=0; } } Will work!!:D |
NPC Code: Why make life harder and lag more? |
Quote:
|
Yes using the move command is better
Possible improvement: let the door fall down fast when closed (instead of slowly closing) A gani would even be better :-) |
Also don't forget to make the link behind the
door using an npc instead of those yellow links, because otherwise people could lag into the link |
there is only one problem with the move command
say you have it so when the player says open the door moves 4 tiles to the left then sleeps for 3 the moves back 4 if you say open again when the sleep is being used it will move over another 4 positions again sosad :( |
ganis ok
but depending on the way you script it that could also be a problem like if it was playing the gani and you said open the gani will start playing again from the start but you could just set a flag then unset it a few secs later like if (playersays(open)&&!opening) { setcharani *whateva,; set opening; sleep 5; unset opening; } that should work without problems but i know Kaimetsu wont like it cause he is anti-flags |
it would be better just to use vars
like this.opening=1; and go like this.opening==0 insted of !opening |
very sorry
would it be better if i used timeout |
ok timeout it is
if (playersays(open)&&!opening) { setcharani whateva,; set opening; timeout = 3; } if (timeout) { unset opening } better? |
o yea
woops 4got bout that and i got one question what do you have against flags |
make a gani of a door going up then do ur script a dontblock and then one of a door closing and do a blockagain
wont lag and will be good ;) |
Contreversy. Ganis may be better but they require you to Download it. Id rath script it with move then to make a gani file for it since its such a simple script =\
|
try this simple one...
NPC Code: |
Simple one. Hahaha that OLD door script. You never even botherd to rename the variables. You bring it apon yourself Ice Pick.
|
Shut the hell up!:grrr:
|
Quote:
he will learn one day |
Ace's Scripting guide is a nice start
the rest is basiclaly done through countless trails and frequent errors. |
yes
practice makes perfect and once your perfect you can show off so really practice just makes show offs :) |
| All times are GMT +2. The time now is 03:52 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.