• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Save Player

Amirosloo

Banned User
Joined
Feb 9, 2012
Messages
33
Reaction score
13
I made this script, Big thank to Znote for helping me a lot in this script!

Its an action, when you use it will save your player, and it got exh. for 10sec! it counts time and got effects :)

It may be useful for some servers :)

All credits to Amiroslo and Znote.

PS: This is just my second script!
Lua:
function onUse(cid, item, fromPos, itemEx, toPos)
	if exhaustion.check(cid, 7645) == false then -- 7645 (Empty storage)
	   exhaustion.set(cid, 7645, 10) -- 7645(same storage as ^, Empty Storage) 10(How many second to wait until u press it again!) 
	if doPlayerSave(cid) then
	   doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
	   doCreatureSay(cid,"Player Saved",TALKTYPE_ORANGE_1)
	end
	else
	   doPlayerSendTextMessage(cid, 17, "You are exhausted for "..(getCreatureStorage(cid, 7645) - os.time()).."!")
	end
	return TRUE
        end
end

XML:
	<action itemid="2345" script="saveplayer.lua" />

Tested on 0.4
Rep++ if I helped you :D!
 
Last edited:
Lua:
 local waittime = 600 --Default (30 seconds)
local storage = 5560
 
function onSay(cid, words, param, channel)
        if exhaustion.get(cid, storage) == FALSE then
                doPlayerSave(cid)
                exhaustion.set(cid, storage, waittime)
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have successfully saved your character.")
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. exhaustion.get(cid, storage) .. " seconds.")
        end    
        return TRUE
end
 
wont work :p
try it ur self :)

Im not sure, but i tried something similar but didnt work
 
Back
Top