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

[CreatureEvent] Message/effect when "hungry".

Alcik

ots.tibiaserver.pl
Joined
Mar 12, 2009
Messages
177
Reaction score
4
Location
Ireland/Polish
Hey everyone that can help. :D No, just kidding. Hey Everyone!

I tried to make the script by myself, but I failed. :D
So:

When player eats food and then after a while, when he is hungry again I want him to get a message like "You are hungry". I also want the message to be sent to the player every minute. So if the player is hungry, he will get a message "You are hungry" every minute.

I hope everything is clear and understandable. ;)
 
Lua:
function onThink(interval, lastExecution, thinkInterval)
	for _, pid in ipairs(getPlayersOnline()) do
		if(getPlayerFood(pid) <= 1) then
			doPlayerSendTextMessage(pid, MESSAGE_EVENT_DEFAULT, "You are hungry.")
			return true
		end
	end
	return TRUE
end
Code:
<globalevent name="hungry" interval="60" script="hungry.lua"/>
 
Ohh, Thanks GarQet. ;)
It is actually not what I wanted. I miss explained it a bit. I was thinking about the system that is on Pokemon servers. And the time should be set to "random", so it is not every minute, but it changes.
 
Back
Top