• 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 My Vip tile is not working

PureDarkSlayer

New Member
Joined
Apr 10, 2009
Messages
62
Reaction score
3
I have a problem that when people step on the vip tile it does not send them back, they can just go in without being vip. I also have a problem with another script that I have for breaking a exp bug at lvl 80; the tile is also no working.

Rep is always given to who helps ^_^
 
Ok ill post them right now.

EDIT:
Exp bug breaker file:
PHP:
function onStepIn(cid, item, frompos, item2, topos)
if item.actionid == 4009 then

 	player1pos = {x=999, y=998, z=7, stackpos=253}
 	player1 = getThingfromPos(player1pos)
  player1level = getPlayerLevel(player1.uid)
questlevel = 80
if player1.itemid > 0 and player1level >= questlevel then

		queststatus = getPlayerStorageValue(cid, 1041)
 if queststatus == -1 then
                   doPlayerSendTextMessage(cid,22,"You obtained 26677200 experience points and gratz on level 111.")
	doPlayerAddExp(cid,26677200)
			setPlayerStorageValue(cid, 1041, 1)
		else
			doPlayerSendTextMessage(cid, 22, "You gain the exp already.")
		end
	end
	return true
end
end

VIP Tile:
PHP:
function onStepIn(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,11551) == 1 then

                   doPlayerSendTextMessage(cid,22,"Welcome VIP, Thank you for your support.")
else
telepos = {x=1010, y=957, z=6}
doTeleportThing(cid,telepos)
doSendMagicEffect(telepos,10)
                   doPlayerSendTextMessage(cid,22,"You are not a donator, buy donation coins at www.silentdoom.webs.com")

	return true
end
end
 
Exp bug breaker file:
Lua:
function onStepIn(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,11551) == 1 then
                   doPlayerSendTextMessage(cid,22,"Welcome VIP, Thank you for your support.")
else
doTeleportThing(cid, frompos)
doSendMagicEffect(frompos, 10)
                   doPlayerSendTextMessage(cid,22,"You are not a donator, buy donation coins at www.silentdoom.webs.com")

	return true
end
end

I think this will work for VIP floor....
If u continue having problems, post ur actions.xml line, where u register this....

To help for second script.....
How it works??? U put an special item on a tile and use a lever so the item dissappear and the player gains exp????
 
Am I supposed to just copy and paste that? because it is still not working and the file is not in my actions folder its in my movements folder if you want to take a look at it.
 
No no no. My problem is that when people are not donators they can still go inside the vip boat, without being donators. Thats what im having a problem with not the lever.
 
Lua:
function onStepIn(cid, item, frompos, item2, topos)

v = getPlayerStorageValue(cid, 11551)

if v < 1 then
	doPlayerSendTextMessage(cid, 22, "You are not a donator, buy donation coins at www.silentdoom.webs.com")
else
	doTeleportThing(cid, {x=1010, y=957, z=6})
	doSendMagicEffect({x=1010, y=957, z=6}, 10)
	doPlayerSendTextMessage(cid, 22, "Welcome VIP, Thank you for your support.")
end                   
	return 1
end

Lua:
function onStepIn(cid, item, frompos, item2, topos)

v = getPlayerStorageValue(cid, 1041)

	if getPlayerLevel >= 80 and getThingfromPos({x=999, y=998, z=7, stackpos=253}.itemid > 0 and v == -1 then
		doPlayerSendTextMessage(cid, 22, "You obtained 26677200 experience points and gratz on level 111.")	
		doPlayerAddExp(cid ,26677200)
		setPlayerStorageValue(cid, 1041, 1)
    else
            doPlayerSendTextMessage(cid, 22, "You gain the exp already.")
		end
	return 1
end
 
Last edited:
Exp bug breaker file:
Lua:
function onStepIn(cid, item, frompos, item2, topos)
if getPlayerStorageValue(cid,11551) == 1 then
                   doPlayerSendTextMessage(cid,22,"Welcome VIP, Thank you for your support.")
else
doTeleportThing(cid, frompos)
doSendMagicEffect(frompos, 10)
                   doPlayerSendTextMessage(cid,22,"You are not a donator, buy donation coins at www.silentdoom.webs.com")

	return true
end
end

I think this will work for VIP floor....
If u continue having problems, post ur actions.xml line, where u register this....

To help for second script.....
How it works??? U put an special item on a tile and use a lever so the item dissappear and the player gains exp????

Where will it tp him? o,o
 
Try using this:
data/movements/scripts/vip.lua
Lua:
function onStepIn(cid, item, pos)



-- teleports config
teleport1 ={x=155, y=43, z=7}

if isPlayer(cid) then

if item.actionid == 13539 then

vip = getPlayerStorageValue(cid,13540)
if vip == -1 then
doPlayerSendCancel(cid,"This area is for VIP players only.")


doTeleportThing(cid,teleport1)

else

end

end

end

end
data/movements/movements.xml
Lua:
<movevent type="StepIn" actionid="13540" event="script" value="vip.lua" />

Tell me if it work or not, so i can try to fix it.
 
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if getPlayerStorageValue(cid,11551) == 1 then
		doPlayerSendTextMessage(cid,22,"Welcome VIP, Thank you for your support.")
		return true
	else
		doTeleportThing(cid,fromPosition)
		doPlayerSendTextMessage(cid,22,"You are not a donator, buy donation coins at www.silentdoom.webs.com")
    return true
	end
end
If this code doesn't work simply try another storage..
 
None have worked yet still =/ I dont know what is wrong.

EDIT: TYVM Milice worked perfectly now ;) your great. As for the others ty for helping I gave rep to all of you.
 
Last edited:
Only thing still not working is this script:
PHP:
function onStepIn(cid, item, frompos, item2, topos)
 
v = getPlayerStorageValue(cid, 1041)
 
	if getPlayerLevel >= 80 and getThingfromPos({x=999, y=998, z=7, stackpos=253}.itemid > 0 and v == -1 then
		doPlayerSendTextMessage(cid, 22, "You obtained 26677200 experience points and gratz on level 111.")	
		doPlayerAddExp(cid ,26677200)
		setPlayerStorageValue(cid, 1041, 1)
    else
            doPlayerSendTextMessage(cid, 22, "You gained the exp already.")
		end
	return true
end
 
Try this one :)
Code:
local pPos = {x=999, y=998, z=7}
local questlevel = 80

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

if(not getPlayerPosition(cid) == pPos) then
	return true
end

local queststatus = getPlayerStorageValue(cid, 1041)

	if(item.actionid == 4009) then
			if(isPlayer(cid) and getPlayerLevel(cid) >= questlevel) then
				if(queststatus ~= 1) then
					doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You obtained 26677200 experience points and gratz on level 111.")
					doPlayerAddExp(cid, 26677200)
					setPlayerStorageValue(cid, 1041, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You gain the exp already.")
				end
			end
	end
-- Return true and end the onStepIn Function
	return true
end
 
Milice copy my viptile script ¬¬
only changed the variables in the function..... (i failed, used the same that in actions... :/ and he used the one that are for movements)
xDDDD
OKS, MY FAIL

@Milice: About the other script:
1. Ur checking the aid (action id) of the floor??? It's not necessary because it checks it automatically, because it is registered on movements....
2. The same that before, you dont need to check player position because it is a step in movement... It means that if player step in a floor that has certain AID or UID (unique id) it launches tthe script.....
3. U need to:
a) Add a local like this: local storage = xxxx
b) Add a local like this: local queststatus = getPlayerStorageValue(cid, storage)
c) Add a function: setPlayerStorageValue(cid, storage, 1), so u have the quest already do

Sorry for bad english and hope the words i wrote will help to fix the script ^^

Already thought that i spent too many time in structions and i better fix the script my way.... LOL
 
Milice copy my viptile script ¬¬
only changed the variables in the function..... (i failed, used the same that in actions... :/ and he used the one that are for movements)
xDDDD
OKS, MY FAIL

@Milice: About the other script:
1. Ur checking the aid (action id) of the floor??? It's not necessary because it checks it automatically, because it is registered on movements....
2. The same that before, you dont need to check player position because it is a step in movement... It means that if player step in a floor that has certain AID or UID (unique id) it launches tthe script.....
3. U need to:
a) Add a local like this: local storage = xxxx
b) Add a local like this: local queststatus = getPlayerStorageValue(cid, storage)
c) Add a function: setPlayerStorageValue(cid, storage, 1), so u have the quest already do

Sorry for bad english and hope the words i wrote will help to fix the script ^^

Already thought that i spent too many time in structions and i better fix the script my way.... LOL

haha i know i just wanted it to be the same script just change some stuff xD
 
Hmm didnt work. Any other solutions?

hmm okay try if this one works then:

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

			if(getPlayerLevel(cid) >= 80) then
				if(getPlayerStorageValue(cid, 1041) ~= 1) then
					doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You obtained 26677200 experience points and gratz on level 111.")
					doPlayerAddExperience(cid, 26677200)
					setPlayerStorageValue(cid, 1041, 1)
				else
					doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You gain the exp already.")
				end
			else
				doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need to be level 80 or higher.")
				doTeleportThing(cid, fromPosition, true)
			end

	return true
end
 
Back
Top