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

Help [creatureevent] When Premium Ends, Teleport to the temple

djblah

Active Member
Joined
Oct 15, 2010
Messages
129
Solutions
2
Reaction score
25
someone who can help me with this script the problem is that teleports the player to have never had premium, which does not have to be this way, only those who bought and their premium finaliso devrian be teleported them, I think the problem is lso storage if anyone can help.

I leave the scrips here


HTML:
if getPlayerPremiumDays(cid) < 1 then
	doTeleportThing(cid,getPlayerMasterPos(cid))
	doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You got teleported to temple, as your premium has expired.')
	doSendMagicEffect(getThingPos(cid),CONST_ME_TELEPORT)
end
 
You need use storages to check if the player was bought the premium before

add this in the buypremium script under off doPlayerAddPremiumDays()

Lua:
setPlayerStorageValue(cid, 64560, 1)

This is your final code
Lua:
if(getPlayerPremiumDays(cid) < 1 and getPlayerStorageValue(cid, 64560) > 0) then
	setPlayerStorageValue(cid, 64560, 0) -- this reset the storage	
	doTeleportThing(cid,getPlayerMasterPos(cid))
	doPlayerSendTextMessage(cid,MESSAGE_FIRST,'You got teleported to temple, as your premium has expired.')
	doSendMagicEffect(getThingPos(cid),CONST_ME_TELEPORT)
end
 
Back
Top