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

GlobalEvent Request

Vittyn

#Learning Linux
Joined
Nov 9, 2008
Messages
384
Reaction score
13
Location
Brasil
I Need a Script that check if player have storage 26000 == 2
and then teleport player to temple....
i have this one, but not working...

PHP:
function onThink(interval, lastExecution)

local teleport = {
temple = {x=463, y=499, z=7 }
}
		if getPlayerStorageValue(uid, 26000) == 2 then
	doTeleportThing(cid, teleport.temple)
	setPlayerGroupId(cid, 1)
	setPlayerStorageValue(cid, 26000, 0)
	doPlayerPopupFYI(cid, "Sua conta VIP acabou !\n\nAtive uma nova conta VIP e ajuda a manter o server ONLINE, e alem de Tudo voce ganha beneficios.")

end
	return TRUE
end

saying this error os console
PHP:
[13/06/2009 15:10:27] Lua Script Error: [GlobalEvent Interface] 
[13/06/2009 15:10:27] data/globalevents/scripts/removevip.lua:onThink

[13/06/2009 15:10:27] luaGetPlayerStorageValue(). Player not found

maybe someone can help me ?
this is for if player lose vip, get teleported to temple, all others needed are done, only this problem,
thanks
 
Lua:
local config = { 
        temple = {x=463, y=499, z=7},
        storage = 26000
}

function onThink(interval, lastExecution) 
    if getPlayerStorageValue(cid, config.storage) == 2 then 
	doTeleportThing(cid, config.temple) 
	setPlayerGroupId(cid, 1) 
	setPlayerStorageValue(cid, config.storage, 0) 
	doPlayerPopupFYI(cid, "Sua conta VIP acabou !\n \nAtive uma nova conta VIP e ajuda a manter o server ONLINE, e alem de Tudo voce ganha beneficios.") 
    end
end
 
Last edited:
I'll rep++ you...
maybe you can do it with
GetPlayerVipTime(accountName) ?
it will be much better, but very thanks :D
 
Last edited:
Wouldnt you rather just make it a Item only VIP players can have to get TPED to the Temple?

Such as

Code:
local exhausttime = 20 * 60 * 1000
local exhaust = createConditionObject(4096)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, exhausttime)

function onUse(cid, item, frompos, item2, topos)
temple = {x=32369, y=32241, z=7, stackpos=1}
effect = math.random (1, 215)
pos = getPlayerPosition(cid)
    if getCreatureCondition(cid, CONDITION_EXHAUST) == TRUE then
        doPlayerSendTextMessage(cid, 21, "You can only TP to the temple once every 20 minutes.")
        return TRUE
end
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
    doSendMagicEffect(pos,2)
    doTeleportThing(cid, temple)
    doSendAnimatedText(temple,"Temple", effect)
    doSendMagicEffect(temple, 10)
    doAddCondition(cid, exhaust)
else
    doPlayerSendTextMessage(cid, 21, "You cannot TP when you are in a Fight.")
end
return 1
end
 
Back
Top