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

Solved mayNotMove function wont work TFS 1.0

Candlejack

Don't hug me I'm scared
Joined
Jun 20, 2012
Messages
87
Reaction score
38
Location
nowhere
I am getting an error when using mayNotMove function. Anyone know why? I'm using TFS 1.0

The problem code is: mayNotMove(itemEx.uid, true)

vf8akw.png


Code:
local config = {
    timee = 60000 -- Seconds
}
local function allowMovement(cid)
    if not isPlayer(cid) then
        return
    end
    mayNotMove(cid, false)
    setPlayerStorageValue(cid,4455,0)
end

local function unCuff(cid)
    doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'Handcuffs have come unloosed. You are no longer restrained.')

end

function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey)

    if isPlayer(itemEx.uid) then
        if getPlayerStorageValue(itemEx.uid,4455) == 1 then
            setPlayerStorageValue(itemEx.uid,4455,2)
        end
        mayNotMove(itemEx.uid, true)
        addEvent(allowMovement, config.timee, itemEx.uid)
        doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,'You have restrained '..getPlayerName(itemEx.uid)..'.')
        doPlayerSendTextMessage(itemEx.uid,MESSAGE_INFO_DESCR,'You are being restrained by '..getPlayerName(cid)..'.')
        addEvent(unCuff, config.timee-3000, itemEx.uid)
        doRemoveItem(item.uid,1)
    end
 
    return true
end
 
I see. From what I read I thought doCreatureSetNoMove was removed and replaced with mayNotMove?

If there an equivalent to this function?
 
It was removed for some reason I don't really understand.
You have 2 options, either implement the code Printer added, Mark said it was a "hack" to get mayNotMove back(imo that would be better then nothing tbh)
Option 2 is to add the code that Mark removed(google "github forgottenserver maynotmove) ~
 
Back
Top