06-10-2015, 11:18 AM
06-10-2015, 11:28 AM
Code:
repeat
if (GetMe():IsAlikeDeath()) then
SetPause(true);
ShowToClient("SYS","I am dead");
Sleep(15*1000);
LogOut();
end;
Sleep(10*1000);
until false;
06-10-2015, 15:46 PM
(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-12-2015, 02:37 AM
Thanks guys.