• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua [Question] Revscript - onEquip/onDeEquip calling external function

_M4G0_

Intermediate OT User
Joined
Feb 6, 2016
Messages
550
Solutions
17
Reaction score
108
Hello,
I'm working with Revscript and I have a question about using onEquip/onDeEquip.
Is it possible to have the onEquip just call an external function instead of writing the full logic inside it?
Example:
LUA:
local moveevent = MoveEvent()

function moveevent.onEquip(player, item, slotPosition, isCheck)
    Function(player, item, slotPosition)
    return true
end

moveevent:register()
In this case, Function would be a separate function defined somewhere else in the script.
Is this the correct way? Will it work properly without issues (scope, variables, etc)?
Or is there anything I need to be careful about when doing this?

Thanks in advance for any help!
 
Back
Top