• 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 Movements [Epic bugs that you don't know are happening to you]

Narzerus

Full-stack developer and old OT Developer
Joined
Oct 29, 2007
Messages
202
Reaction score
11
I have found lots of annoying bugs that have to do with movements

(Like the one that movements on-equip execute twice osometimes, and others)

Well I've managed to evade these problems by adding limitations to my ingame systems (which is not the ideal solution)

But in this particular case I don't know how to to that, so I need to do a little investigation.

One of the most annoying bugs of this events is when they don't execute, or execute for a wierd reasons.

For example, If you have an armor on the floor which has a movement script assigned to its itemid, leave it on the floor, and make sure you don't have enough capacity to wear it.

Now try wearing it on the armor slot directly, what happens is the following:
The OnEquip event is triggered however, you get the "It's too heavy." message and the armor stays on the floor.. This can causes alot of bugs on my item enhancing system!

Another example, if you sell equipped item to npcs, the OnDeEquip event is not triggered, making my scirpt think you are still wearing the armor. Annoying too!

So, anyone knows how to:
1.- Fix these anoying bugs (I bet this is source editing, which I would do If extremely needed)

or 2.- Go around these bugs, like for example avoiding a way to go around these bugs..

I think (while typing) that by getting the difference of players capacity and item's weight I could emulate the servers "It's too heavy" and make sure that way that it's not gonna bug my system.


Thanks!
 
-- This will avoid the onEquip Bugs
-- Rep ++ please !!

LUA:
local check

function onEquip(cid, item, slot)

	if item.uid == check then
		return true
	end

	check = item.uid

	if getPlayerFreeCap(cid) < getItemWeight(item.uid) then
		return true
	end

--- Your code come here !!
end
 
Yes I know that, Was wondering is there mas a better way than having to edit each onEquip script with that condition, I already did a similar code to check the double execution on every OnEquip xD, still thanks and rep ++ ;)!
 
Back
Top