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

Need script easy!

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,920
Reaction score
59
One script that takes away your days of premium account with one item.
doPlayerRemovePremiumDays(cid, 30)


A door, only premium players can pass and tile Also.

and if they can fix this so that no more than 90 days premium .. thanks.


function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPremiumDays(cid) > 90 then
doPlayerSendCancel(cid, "You can only have 90 days of premium account.")
else

doPlayerAddPremiumDays(cid, 30)
doPlayerSendTextMessage(cid, "We have added 30 vip days to your account!.")
doSendMagicEffect(topos,24)
doRemoveItem(item.uid)

end
return true
end

Thx
 
LUA:
local storage = 12344;
function  onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerStorageValue(cid,12344) ~= 1) then
doPlayerRemovePremiumDays(cid, 30);
setPlayerStorageValue(cid,storage,1);
else
doPlayerSendCancel(cid,"You cannot use this item again")
end
return true
end

LUA:
function  onUse(cid, item, fromPosition, itemEx, toPosition)
if(not isPremium(cid)) then
doPlayerSendCancel(cid,"You need premium to enter")
return false;
end
return true;
end

LUA:
function  onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if(not isPremium(cid)) then
doPlayerSendCancel(cid,"You need premium to enter")
doTeleportThing(cid,(fromPosition.x ==0) and getPlayerMasterPos(cid) or fromPosition)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You May Pass");
end
return true
end

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPremiumDays(cid) >= 90 then
doPlayerSendCancel(cid, "You can only have 90 days of premium account.")
return false;
end
doPlayerAddPremiumDays(cid, math.min(90-getPlayerPremiumDays(cid),30))
doPlayerSendTextMessage(cid, "We have added "..math.min(90-getPlayerPremiumDays(cid),30).." vip days to your account!.")
doSendMagicEffect(topos,24)
doRemoveItem(item.uid)

return true
end
 
Last edited:
=S error in console..

[Error - Action Interface]
[22/06/2010 22:42:15] data/actions/scripts/other/premium.lua:onUse
[22/06/2010 22:42:15] Description:
[22/06/2010 22:42:15] (luaDoPlayerSendTextMessage) Player not found

[22/06/2010 22:42:15] [Error - Action Interface]
[22/06/2010 22:42:15] data/actions/scripts/other/premium.lua:onUse
[22/06/2010 22:42:15] Description:
[22/06/2010 22:42:15] attempt to index a nil value
[22/06/2010 22:42:15] stack traceback:
[22/06/2010 22:42:15] [C]: in function 'doSendMagicEffect'
[22/06/2010 22:42:15] data/actions/scripts/other/premium.lua:8: in function <data/actions/scripts/other/premium.lua:1>

ANd this..

[22/06/2010 22:46:50] [Warning - Groups::getGroup] Group 0 not found.
[22/06/2010 22:46:50] [Warning - Groups::getGroup] Group 0 not found.

=S
 
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerPremiumDays(cid) >= 90 then
doPlayerSendCancel(cid, "You can only have 90 days of premium account.")
return false;
end
doPlayerAddPremiumDays(cid, math.min(90-getPlayerPremiumDays(cid),30))
doPlayerSendTextMessage(cid, 30, "We have added "..math.min(90-getPlayerPremiumDays(cid),30).." vip days to your account!.")
doSendMagicEffect(getPlayerPosition(cid), 24)
doRemoveItem(item.uid)

return true
end
 
Last edited:
Lol!

when I use the item id 2155, gives me the days of premium account but .. gives me debug = S and closed tibia = S
 
Change:
Code:
doPlayerSendTextMessage(cid, [B][COLOR="Red"]30[/COLOR][/B], "We have added "..math.min(90-getPlayerPremiumDays(cid),30).." vip days to your account!.")
doSendMagicEffect(getPlayerPosition(cid), 24)
To one of these:
Code:
MESSAGE_STATUS_CONSOLE_RED = 18
MESSAGE_EVENT_ORANGE = 19
MESSAGE_STATUS_CONSOLE_ORANGE = 20
MESSAGE_STATUS_WARNING = 21
MESSAGE_EVENT_ADVANCE = 22
MESSAGE_EVENT_DEFAULT = 23
MESSAGE_STATUS_DEFAULT = 24
MESSAGE_INFO_DESCR = 25
MESSAGE_STATUS_SMALL = 26
MESSAGE_STATUS_CONSOLE_BLUE = 27
 
up: if it was it, change it yesterday thanks

In script of door:
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not isPremium(cid)) then
doPlayerSendCancel(cid,"You need premium to enter")
return false;
end
return true;
end

Waht action id put in xml? and rme?
 
I put in a normal door [8545] 2224 action id and xml --->


actionid="2224" <action event="script" value="other/door2.lua"/>

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not isPremium(cid)) then
doPlayerSendCancel(cid,"You need premium to enter")
return false;
end
return true;
end

But when I give him to the vip door without telling me
You Need premium to enter ... but when I do nothing .. VIP not open ..= S
 
Last edited:
something like this:
LUA:
  function  onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 12345
local position = {x=xxx,y=yyy,z=z}
if getPlayerStorage(cid, 12345) >= 1 then
doTeleportThing(cid,position,true)
else
doPlayerSendCancel(cid,"You need vip to enter")
return false
end
return true
end
?
 
Bump!.. nedd script door vip... not work..

Ehh..
But Quas gave you a script for door...?
LUA:
  function  onUse(cid, item, fromPosition, itemEx, toPosition)
local position = {x=xxx,y=yyy,z=z}
if isPremium(cid) then
doTeleportThing(cid,position,true)
else
doPlayerSendCancel(cid,"You need premium to enter")
return 0
end
return true
end
or maybe
LUA:
  function  onUse(cid, item, fromPosition, itemEx, toPosition)
if not isPremium(cid) then
doPlayerSendCancel(cid,"You need premium to enter")
return false
else
return 1
end
end
I'm not sure about second :S
 
Up: yes quas give mi script of premiun door but don`t work for my :S

used tfs 0.3.6 pl1 for testing

don`t word you script wesoly
 
I just need the function so that when the player is able to pass the gate premium as would be the scripr or function?

function onUse(cid, item, fromPosition, itemEx, toPosition)
if not(isPremium(cid)) then
doPlayerSendCancel(cid,"You need premium to enter")
return false
else
doPlayerSendCancel(cid,"You are premium")
return true
end
end
 
look .. I have this script that I work well ... what happens is that bug me when I give him as many times .. I can fix it?



function onUse(cid, item, fromPosition, itemEx, toPosition)
if not(isPremium(cid)) then
doPlayerSendCancel(cid,"You need premium to enter")
return false
else
doPlayerSendCancel(cid,"You are premium")
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition)

return true
end
end


391bugssss.bmp
 
Back
Top