• 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 Problem with VIP script GOLBALEVENT!

Zarabustor

Human Being
Joined
Sep 10, 2009
Messages
186
Reaction score
0
Location
Cancun, Mexico
Hi im using tfs 3.6 pl1, and i have a problem with a script look:
suppusly it should works fine, really in the console there're no problems but the pronlem is don happens nothing, please help me to fix it and make it works 100%.

<globalevent name="VIP" interval="10" event="script" value="vip.lua"/>

function onThink(interval, lastExecution, thinkInterval)
for _, cid in ipairs(getPlayersOnline()) do
if getPlayerStorageValue(cid, 11551) == 1 then
doSendAnimatedText(getCreaturePosition(cid), "VIP!", TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
end
end
return true
end
 
xDD let's see if the script executes at all:
Code:
function onThink(interval, lastExecution, thinkInterval)
	for _, pid in ipairs(getPlayersOnline()) do
		--if getPlayerStorageValue(pid, 11551) == 1 then
			doSendAnimatedText(getCreaturePosition(pid), "VIP!", TEXTCOLOR_RED)
			doSendMagicEffect(getCreaturePosition(pid), CONST_ME_GIFT_WRAPS)
		--end
	end
	return true
end
 
:o it work now very good, but now another problem the script executes in all player :S also player without VIP :S, i want just player with the storage value 11551 (VIP PLAYERS)

Thanks and REP++
 
Whoops I forgot to post since that downtime ...

Code:
function onThink(interval, lastExecution, thinkInterval)
	for _, pid in ipairs(getPlayersOnline()) do
		doPlayerSendTextMessage(pid, MESSAGE_EVENT_DEFAULT, "You " .. (getPlayerStorageValue(pid, 11551) > -1 and "" or "don't ") .. "have a VIP account!")
		if getPlayerStorageValue(pid, 11551) > -1 then
			doSendAnimatedText(getCreaturePosition(pid), "VIP!", TEXTCOLOR_RED)
			doSendMagicEffect(getCreaturePosition(pid), CONST_ME_GIFT_WRAPS)
		end
	end
	return true
end
 
Back
Top