Hello again.
I'm requesting two scripts that shouldn't be that hard. I'm not the most skilled scripter, that's why I'm asking for your help.
One Script for an NPC and another script for something else.
First the NPC script:
The purpose of this NPC is that you can say "Open" to him and he will lower a UID and after some time it will nudge it up again to normality.
What I want from this NPC is to have a timer. So when you say Open it will open and after some time it closes. But when you say Open again to him he will say that you have to wait X minutes to open the gates again. Let's say 30 minutes.
Now I managed to make everything work, except the ItemDef m_traitor_wall_5hoursdelay. Everything else works fine if I remove that ID.
The following code DOESN'T work but I think the structure of it is correct.
Nevermind this one has been fixed!
Old One (Doesn't work)
[CHARDEF c_traitor1]
ID = c_man
NAME = Traitor
TSPEECH = spk_traitor1
ON = @Create
STR= 10000
DEX= 10000
INT= 10000
ITEMNEWBIE= random_male_hair
COLOR= colors_hair
ITEMNEWBIE= random_facial_hair
COLOR= match_hair
ITEMNEWBIE= i_CAPE
COLOR= 07a0
ITEMNEWBIE= i_robe
COLOR= 07a0
[SPEECH spk_traitor1]
on=*Open*
If !(<SRC.FINDID.m_traitor_wall_5hoursdelay.UID>) // Problem
say You must wait <eval (<SRC.FINDID.m_traitor_wall_5hoursdelay.timer>/60)> minutes before I can crack the walls again. // Problem
Return 1 // Problem
Endif // Problem
If (<tag0.gatesopen>==01)
Say Fool! Can't you see the walls are already open?
Return 1
else
serv.newitem m_traitorA1
EQUIP <NEW.UID>
serv.newitem m_traitorA2
EQUIP <NEW.UID>
serv.newitem m_traitor_wall_5hoursdelay // Part of the problem
EQUIP <NEW.UID> // Part of the Problem
Return 1
ENDIF
[ItemDef M_traitorA1]
id=i_memory
Name=Traitor Time Delay A1
type=t_eq_script
ON=@Create
TIMER = 0
MORE1 = 1
ON=@Timer
If (<more1> == 1)
cont.say It's open! Get in before they find out!
remove
endif
return 1
ON=@UNEQUIP
CONT.TAG.gatesopen=1
CONT.tag.gatesclosed=
OBJ = <UID.0438edbe7>
OBJ.nudgedown 25
[ItemDef M_traitorA2]
id=i_memory
Name=Traitor Time Delay A2
type=t_eq_script
ON=@Create
TIMER = 10
ON=@Timer
IF (<CONT.TAG0.GATESOPEN>==1)
CONT.TAG.gatesopen=
CONT.tag.gatesclosed=1
OBJ = <UID.0438edbe7>
OBJ.nudgeup 25
CONT.SAY They found us and fixed the walls!
ENDIF
REMOVE
RETURN 1
[ItemDef m_traitor_wall_5hoursdelay] // Maybe this part is alright?
id=i_memory
Name=Stuck Teleport Delay
type=t_eq_script
ON=@Create
TIMER = 20
ON=@Timer
REMOVE
RETURN 1
New One. It works!
[CHARDEF c_traitor1]
ID = c_man
NAME = Traitor
TSPEECH = spk_traitor1
ON = @Create
STR= 10000
DEX= 10000
INT= 10000
ITEMNEWBIE= random_male_hair
COLOR= colors_hair
ITEMNEWBIE= random_facial_hair
COLOR= match_hair
ITEMNEWBIE= i_CAPE
COLOR= 07a0
ITEMNEWBIE= i_robe
COLOR= 07a0
[SPEECH spk_traitor1]
on=*open*
if (<findid.m_traitor_wall_delay.uid>) //search for the memory. i suppose the NPC is the CONT.
say You must wait <eval (<findid.m_traitor_wall_delay.timer>/60)> minutes before I can crack the walls again. // if it exists, you wait.
return 1
else
serv.newitem m_traitorA1 //creates the item to lower the doors.
equip <new.uid>
serv.newitem m_traitor_wall_delay
equip <new.uid>
say It's open! Get in before they find out!
return 1
endif
[ITEMDEF M_traitorA1]
ID=i_memory
NAME=Traitor Time Delay A1
type=t_eq_script
on=@create
timer=10 //time the gate stays open
on=@equip // gates go down
cont.tag.gatesopen=1
cont.tag.gatesclosed=
obj=<uid.0438c8336>
obj.nudgedown 25
on=@timer //after that time, gates go up.
cont.tag.gatesopen=
cont.tag.gatesclosed=1
obj=<uid.0438c8336>
obj.nudgeup 25
remove
Return 1
[ITEMDEF m_traitor_wall_delay]
id=i_memory
name=Wall Delay
type=t_eq_script
ON=@Create //cooldown to open gates again
timer=100
ON=@Timer
remove
return 1
The Second Script might be a little bit more complicated. I'll try to explain my best.
I need a function, it can be for the command .expel , that if you are in a specific area, let's say Moonglow, you can use it to Expel players out of that area.
I want everyone to be able to use that command. But ONLY in that area. If you are outside that Area it says a message saying you can't use this command here or something.
Now. I don't want the .expel to be used on everyone. I want only to be used on people that have a "tag?" (not sure if I'm using the right word). If you try to use it on people that don't have a Tag it says you can't use it on them.
Also if possible, can it be made so that it can't target Incognito players? "You can't expel incognito players".
And to get that tag, people need to trigger a telepad.
This Telepad will give you 2 tags and not just 1.
The First Tag is the one that makes you a candidate to be used the command .expel on you. It should have a timer of 48 hours.
Also the tag is removed when someone uses .expel on you
The Second Tag is a tag that lasts 30 minutes and prevents you from being .expel .
Meaning when you use the telepad, for 30minutes you can't be expelled. But after that time you can be expelled.
Thank's for the help,
Fronz