• 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 [TFS 1.3] onMoveItem

Apollos

Dude who does stuff
Premium User
Joined
Apr 22, 2009
Messages
845
Solutions
123
Reaction score
690
Location
United States
Using Player.onMoveItem to recall a table that has the names of players who are inside an event in order to remove them when the item is moved and then end the event. My problem is that I have dofile connecting to the lib which has the player file but it's not getting any of the players data. I was thinking maybe it's because player.lua is loaded once? Idk, its a grey area for me. Also I seen that summ and mock had functions created for a creatureevent onMoveItem and I can try to set it up if I absolutely need to but wondering if there's something I'm not understanding lua sided first. Thanks!
 
Solution
don't use dofile
just make your table global and access it that way
dofile will only insert the code into player.lua once it gets loaded, changing anything inside of your lib will not change in player.lua, it's copied and not a reference to the original tables and variables
don't use dofile
just make your table global and access it that way
dofile will only insert the code into player.lua once it gets loaded, changing anything inside of your lib will not change in player.lua, it's copied and not a reference to the original tables and variables
 
Solution
don't use dofile
just make your table global and access it that way
dofile will only insert the code into player.lua once it gets loaded, changing anything inside of your lib will not change in player.lua, it's copied and not a reference to the original tables and variables

My dude, ty.
 

Similar threads

Back
Top