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

Lua Npc repeats functions with incrementing (i++)

mackerel

Well-Known Member
Joined
Apr 26, 2017
Messages
398
Solutions
18
Reaction score
72
Found this great mod for server (marriage system) here :

NPC - [TFS 1.0] Marriage System

but there is a problem with incrementing, more specifically this line here, inside confirmRemoveEngage function:

Lua:
node:addChildKeyword({'yes'}, removeEngage, {moveup = 3, text = 'Ok, your marriage proposal to {' .. getPlayerNameById(playerSpouse) .. '} has been removed. Take your wedding ring back.'})

The first time, the function removeEngage is being executed once
The second time you propose to someone and revoke your proposal. It will execute the function twice, also giving you back 2 rings
The third time will execute the function three times and so on.....

I have no experience with NPCs, thats why I am writing it here so hopefully someone can help me a little bit to prevent that from happening

using tfs 1.0
 
Back
Top