• 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!

doCreatureSetNoMove(cid, true) and ?

MateQ

New Member
Joined
Oct 31, 2008
Messages
13
Reaction score
3
Hi!

I want to make this script:

After using sleeping pills, character go sleep, he can't use nothing, can't move and can't attack anybody.
Every 0.5s he is healing 0.5% heal and mana. And after 10s he wake up and everythink is like before.

I have all of this script, but here is one problem:
I don't know command to "can't attack and use anything".

Anyone help ?

www.narutoworldserver.pl
 
Prevention/reduction of anything can be resolved with conditions.

Also don't say you have a script and not post it, because if you have no intention of posting it there is no point in mentioning it..
 
Right.

Code:
 local exhausted_seconds = 5*60
    local exhausted_storagevalue = 7485
    local klucz = 75005


function onUse(cid, item, frompos, item2, topos)
    if(os.time() > getPlayerStorageValue(cid, exhausted_storagevalue)) then
    spanie = getPlayerStorageValue(cid, klucz)
    doCreatureSetNoMove(cid, true)
    doSendMagicEffect(frompos, CONST_ME_SLEEP)
    setPlayerStorageValue(cid, klucz, 0)
    addEvent(sleep,500, cid)
    doRemoveItem(item.uid, 1)
    setPlayerStorageValue(cid, exhausted_storagevalue, os.time() + exhausted_seconds)
    else
    timeleft = getPlayerStorageValue(cid, exhausted_storagevalue)-os.time()
        if timeleft >= 60 then
        min1 = timeleft/60
        min = math.floor(min1)
        sec1 = timeleft-min*60
        sec = math.floor(sec1)
        doPlayerSendTextMessage(cid, 19, "You need to wait "..min.." minutes and "..sec.." second.")
        elseif timeleft < 60 then
        doPlayerSendTextMessage(cid, 19, "You need to wait "..timeleft.." second.")
        end
    end
end

function sleep(cid)
maxzycie = getCreatureMaxHealth(cid)
zycie = getCreatureHealth(cid)
maxmana = getCreatureMaxMana(cid)
mana = getCreatureMana(cid)


        if zycie < maxzycie then
            if getPlayerStorageValue(cid, klucz) < 20 then
            setPlayerStorageValue(cid, klucz, getPlayerStorageValue(cid, klucz)+1)
            doSendMagicEffect(getPlayerPosition(cid), CONST_ME_SLEEP)
            doCreatureAddHealth(cid, 0.005*maxzycie)
            doSendAnimatedText(getPlayerPosition(cid), 0.005*maxzycie, TEXTCOLOR_LIGHTGREEN)
            doCreatureAddMana(cid, 0.005*maxmana)
            doSendAnimatedText(getPlayerPosition(cid), 0.005*maxmana, TEXTCOLOR_LIGHTBLUE)
            addEvent(sleep,500, cid)
            else
            doCreatureSetNoMove(cid, false)
            doSendAnimatedText(getPlayerPosition(cid), "WAKE UP", TEXTCOLOR_LIGHTBLUE)
            setPlayerStorageValue(cid, klucz, -1)
            end
        else
        doCreatureSetNoMove(cid, false)
        doSendAnimatedText(getPlayerPosition(cid), "WAKE UP", TEXTCOLOR_LIGHTBLUE)
        setPlayerStorageValue(cid, klucz, -1)
        end
end
 
Back
Top