L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dc when dead
Author Message
newl2japan12 Offline
Expired VIP Member
**

Posts: 7
Joined: Jan 2015
Reputation: 0
Version: 1.4.3.143
Post: #1
Dc when dead

How to make any script to disconnect when dead?
Help pls.
06-10-2015 11:18 AM
Find all posts by this user Quote this message in a reply
aiwaras83 Offline
Expired VIP Member
**

Posts: 29
Joined: Oct 2013
Reputation: 4
Version: 1.4.2.135
Post: #2
RE: Dc when dead

Code:
repeat
if (GetMe():IsAlikeDeath()) then
    SetPause(true);
    ShowToClient("SYS","I am dead");
    Sleep(15*1000);
    LogOut();
end;

Sleep(10*1000);
until false;
(This post was last modified: 06-10-2015 11:28 AM by aiwaras83.)
06-10-2015 11:28 AM
Find all posts by this user Quote this message in a reply
 Reputed by : newl2japan12(+2)
capucine Offline
Expired VIP Member
**

Posts: 1,083
Joined: Jan 2013
Reputation: 208
Version: 1.4.2.142
Post: #3
RE: Dc when dead

(06-10-2015 11:18 AM)newl2japan12 Wrote:  How to make any script to disconnect when dead?
Help pls.

I use this script... U can easily change the number of minutes to wait for REZ until it logout... So it gives u time to rez your toon if u can, if not, it will logout after SET minutes...

    LUA Programming
min_to_w8 = 10;-- Minutes to w8 for ress
 
ShowToClient(tostring(os.date("%X")),"Log out if dead "..min_to_w8.." min has been loaded for  " .. GetMe():GetName() .. ".",3);
 
 
--ShowToClient("Script","Log out if char die "..min_to_w8.." min.");
repeat 
    Sleep(1000)
    if (GetMe():IsAlikeDeath() == true) then    
        ShowToClient("Script", "W8 for resurection.",3);
        Sleep(1000*60*min_to_w8);  
        if (GetMe():IsAlikeDeath() == true) then
            --ShowToClient("Script", "Bye.");
            LogOut();
        end
    end
until false

06-10-2015 15:46 PM
Find all posts by this user Quote this message in a reply
 Reputed by : newl2japan12(+2)
newl2japan12 Offline
Expired VIP Member
**

Posts: 7
Joined: Jan 2015
Reputation: 0
Version: 1.4.3.143
Post: #4
RE: Dc when dead

Thanks guys.
06-12-2015 02:37 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)