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

[Globalevent] Modify script, is it possible?

Knight God

Member
Joined
Oct 19, 2008
Messages
1,180
Reaction score
21
Well let me know if you can modify my script so that every time you leave the word "Doner" This regenerate hp, mana, 3 of soul and has the ability to never give you hunger?.
Please if I can help.
thank you.:rolleyes::p

Script:
PHP:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerVipDays(cid) >= 1 then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Doner!", TEXTCOLOR_RED)
               end
         end
         return true
end
 
Well let me know if you can modify my script so that every time you leave the word "Doner" This regenerate hp, mana, 3 of soul and has the ability to never give you hunger?.
Please if I can help.
thank you.:rolleyes::p

Script:
PHP:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerVipDays(cid) >= 1 then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Doner!", TEXTCOLOR_RED)
               end
         end
         return true
end
What do you mean? :o
 
If you can modify this script!
one that when you leave the word "Doner" recover your life the 150 and 150 mana, 3 of soul.
LUA:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerVipDays(cid) >= 1 then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Doner!", TEXTCOLOR_RED)
		  doCreatureAddHealth(cid, 150)
		  doCreatureAddMana(cid, 150)
		  doCreatureAddSoul(cid, 3)
               end
         end
         return true
end
Piece of cake :D.
 
Last edited by a moderator:
Well let me know if you can modify my script so that every time you leave the word "Doner" This regenerate hp, mana, 3 of soul and has the ability to never give you hunger?.
Please if I can help.
thank you.:rolleyes::p

Script:
PHP:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerVipDays(cid) >= 1 then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Doner!", TEXTCOLOR_RED)
               end
         end
         return true
end



PHP:
[03/09/2011 12:18:36] [Error - GlobalEvent Interface] 
[03/09/2011 12:18:36] data/globalevents/scripts/vipEffect.lua:onThink
[03/09/2011 12:18:36] Description: 
[03/09/2011 12:18:36] data/globalevents/scripts/vipEffect.lua:7: attempt to call global 'doPlayerAddHealth' (a nil value)
[03/09/2011 12:18:36] stack traceback:
[03/09/2011 12:18:36] 	data/globalevents/scripts/vipEffect.lua:7: in function <data/globalevents/scripts/vipEffect.lua:1>
[03/09/2011 12:18:36] [Error - GlobalEvents::think] Couldn't execute event: vipEffect


:S error
 
This script checks if they got max health or mana, or if they got max soul, it wont add soul.

LUA:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerVipDays(cid) >= 1 then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Doner!", TEXTCOLOR_RED)
					if not getCreatureMaxHealth(cid) == getCreatureHealth then
					doCreatureAddHealth(cid, 150)
					if not getCreatureMaxMana(cid) == getCreatureMana then
					doCreatureAddMana(cid, 150)
					if getPlayerSoul(cid) <= 197 then
					doPlayerAddSoul(cid, 3)
					end
               end
         end
	end
end
         return true
         end

The preview broke the tabbing.
 
This script checks if they got max health or mana, or if they got max soul, it wont add soul.

LUA:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerVipDays(cid) >= 1 then
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Doner!", TEXTCOLOR_RED)
					if not getCreatureMaxHealth(cid) == getCreatureHealth then
					doCreatureAddHealth(cid, 150)
					if not getCreatureMaxMana(cid) == getCreatureMana then
					doCreatureAddMana(cid, 150)
					if getPlayerSoul(cid) <= 197 then
					doPlayerAddSoul(cid, 3)
					end
               end
         end
	end
end
         return true
         end

The preview broke the tabbing.

Bugged, there are functions without params..
LUA:
function onThink(interval, lastExecution)
	for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerPremiumDays(cid) > 0 then
			if getCreatureHealth(cid) < getCreatureMaxHealth(cid) then
				doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
			end
			if getCreatureMana(cid) < getCreatureMaxMana(cid) then
				doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
			end
			if getPlayerSoul(cid) < 200 then
				doPlayerAddSoul(cid, 200 - getPlayerSoul(cid))
			end
		end

		doSendAnimatedText(getCreaturePosition(cid), "Doner", TEXTCOLOR_RED)
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
	end
	return true
end
 
PHP:
function onThink(interval, lastExecution)
         for _, name in ipairs(getOnlinePlayers()) do
         local cid = getPlayerByName(name)
               if getPlayerVipDays(cid) >= 1 then
		  doCreatureAddHealth(cid, 150)
		  doPlayerAddMana(cid, 250)
                  doSendMagicEffect(getPlayerPosition(cid), 27)
                  doSendAnimatedText(getPlayerPosition(cid), "Doner!", TEXTCOLOR_RED)
		  doPlayerAddSoul(cid, 3)
               end
         end
         return true
end

work nice ty both
 
Back
Top