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

Close Thread Please.

Lava Titan

Developer
Joined
Jul 25, 2009
Messages
1,571
Solutions
3
Reaction score
98
Location
Portugal
Heya OtLand!

I need help on a script:

TFS: 0.3.4
Vip Storage ID: 19551
Script type: Globalevents
Interval time = 3 seconds

VIP.jpg

Script help: i think it is a "function onThink" script
Its like each 3 seconds it sends animated text "Vip" and effect "CONST_ME_GIFT_WRAPS" if a player is vip.

Effects:

doSendAnimatedText(getPlayerPosition(cid), "Vip", TEXTCOLOR_RED)

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)

Thanks!
 
LUA:
    for _, player in ipairs(getOnlinePlayers()) do
    if getPlayerStorageValue(player, 19551) >= 1 then
      doSendAnimatedText(getThingPos(player), "Vip", TEXTCOLOR_RED)
      doSendMagicEffect(getThingPos(player), CONST_ME_GIFT_WRAPS)
    end
    end

I think is it...
 
LUA:
  for _, player in ipairs(getOnlinePlayers()) do
doSendAnimatedText(getThingPos(player), "Vip", TEXTCOLOR_RED)
doSendMagicEffect(getThingPos(player), CONST_ME_GIFT_WRAPS)
end 
return true
omg.
 
LUA:
function onThink()
	for _, player in ipairs(getOnlinePlayers()) do
		if getPlayerStorageValue(player, 19551) >= 1 then
		  doSendAnimatedText(getThingPos(player), "Vip", TEXTCOLOR_RED)
		  doSendMagicEffect(getThingPos(player), CONST_ME_GIFT_WRAPS)
		end
	end
	return TRUE
end

Sorry...I'll pay atention next time X:
 
Globalevents:

PHP:
function text(interval, lastExecution)
for _, name in ipairs(getOnlinePlayers()) do
		local player = getPlayerByName(name)
		local playerPos = getPlayerPosition(player)
		if getPlayerStorageValue(player, 19551) >= 1 then
			doSendAnimatedText(playerPos, 'Vip!', 144)
                  doSendMagicEffect(getThingPos(player), CONST_ME_GIFT_WRAPS	
		end
	end
end 

function onThink(interval, lastExecution)
    addEvent(text, 1000)
	return TRUE
end

try this 1

if u don't know how to put in globalevents.xml post here :p
 
LUA:
function onThink(interval, lastExecution, thinkInterval)
	for _, cid in ipairs(getPlayersOnline()) do
		if getPlayerStorageValue(cid, 19551) > 0 then
			doSendAnimatedText(getCreaturePosition(cid), "Vip", TEXTCOLOR_RED)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
		end
	end
	return true
end

PHP:
	<globalevent name="vip" interval="3" event="script" value="SCRIPT_NAME.lua"/>
 
Back
Top