• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Reward on good text edit :)

averatec

Advanced OT User
Joined
Jun 1, 2007
Messages
2,243
Solutions
4
Reaction score
159
Location
Poland
Lua:
local config =
{
	code = "code",
	itemid = 111, -- put your item id(writeable!!!)
	gift =
	{ 
		id = 111, -- put your gift id
		count = 1
	}
}

function onTextEdit(cid, item, newText)

	if (item.itemid ~= config.itemid) then
		return false
	end
	
	if (newText ~= config.code) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Fail")
		return false
	end
	
	doPlayerAddItem(cid, config.gift.id, config.gift.count)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Pass")
	
	return true
end
Code:
<event type="texedit" name="RewardOnTextEdit" event="script" value="script.lua"/>

Rep++ :)
 
Back
Top