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

Whats wrong with this actions?

Sir MoX

New Member
Joined
Jan 14, 2009
Messages
285
Reaction score
1
well In the first one is the premium bridge of rookgard but when a player NON premium pass says the same thing as it were premium "you are premium, pass" and the player pass why its that if he is NON premium:

function onStepIn(cid, item, pos)

if item.actionid == 2000 and item.itemid == 446 then

if isPremium(cid) then
doPlayerSendTextMessage(cid,22,"You have premium, Pass.")
doTransformItem(item.uid, item.itemid+1)
else
cidd = getPlayerPosition(cid)

local pos = {x=1008, y=991, z=7, stackpos=1}
doTeleportThing(cid,pos)
doPlayerSendTextMessage(cid,22,"Only Premium players are allowed to cross the bridge.")
end
end
end

function onStepOut(cid, item, pos)

if item.actionid == 2000 and item.itemid == 447 then
if isPremium(cid) then
doTransformItem(item.uid, item.itemid-1)
end
end
end

and the second its for the lvl 2 way to the rookgard huntings but instead of let him go the player teleports 1 floor down:
function onStepIn(cid, item, pos)

endpos = {x=1008, y=996, z=7}
level = getPlayerLevel(cid)
msg = "Only player level 2 may pass!"

if item.actionid == 9101 and level < 2 then

doTeleportThing(cid, endpos)
doSendMagicEffect(endpos, 14)
doPlayerSendTextMessage(cid, 22, msg)
end
if level >= 2 and item.itemid == 446 then
doTransformItem(item.uid, 445)
end
return 1

end
function onStepOut(cid, item, pos)

if level >= 2 and item.itemid == 445 then
doTransformItem(item.uid, 446)
end
end

please someone help me! :confused: :)
 
Im nab in scripting but I think the first must be something like

if isPremium(cid) == TRUE then


try this from otfans

Code:
function onStepIn(cid, item, position, fromPosition)
	if isPlayer(cid) == TRUE then
		if isPremium(cid) == FALSE then
			 doTeleportThing(cid, fromPosition, TRUE)
			 doSendMagicEffect(position, 12)
		end
	end
	return TRUE
end

Code:
<movevent event="StepIn" actionid="200" script="<span class="highlight">premium</span>.lua"/>
 
Code:
function onStepIn(cid, item, pos) 

local look = getPlayerLookDir(cid) 

 if isPremium(cid) ~= 1 then
        if look == 0 or look == 1 then
          doMoveCreature(cid, look+2)
        elseif look == 2 or look == 3 then
          doMoveCreature(cid, look-2)
        end
  doPlayerSendTextMessage(cid,21, "You need premium to walk through this tile.")
 else
   return 0
 end
end

Code:
function onStepIn(cid, item, pos) 

local look = getPlayerLookDir(cid) 

 if getPlayerLevel(cid) < 2 then
        if look == 0 or look == 1 then
          doMoveCreature(cid, look+2)
        elseif look == 2 or look == 3 then
          doMoveCreature(cid, look-2)
        end
  doPlayerSendTextMessage(cid,21, "You need 2 level to walk through this tile.")
 else
   return 0
 end
end
 
Last edited:
Maybe this works. Note that I changed the action ID from 2000 to 3000 because afaik aid 2000 is used by the quest chest system in TFS.

PHP:
function onStepIn(cid, item, pos)

local pos 	= {x=1008, y=991, z=7, stackpos=1}
local player	= getThingfromPos(cid)


	if item.actionid == 3000 and item.itemid == 446 then

		if isPremium(cid) == TRUE and isPlayer(cid) == TRUE then

			doPlayerSendTextMessage(cid,22,"You are premium. You may pass.")
			doTransformItem(item.uid, item.itemid+1)

		else

			doTeleportThing(player.uid, pos, FALSE)
			doPlayerSendTextMessage(cid,22,"Sorry, only Premium players are allowed to cross the bridge.")

		end

	end

end

function onStepOut(cid, item, pos)

	if item.actionid == 3000 and item.itemid == 447 then

		if isPremium(cid) == TRUE then

			doTransformItem(item.uid, item.itemid-1)

		end

	end

end
 
SteamSide the part is already in the script

local pos = {x=1008, y=991, z=7, stackpos=1}
local player = getThingfromPos(cid)


if item.actionid == 3000 and item.itemid == 446 then

if isPremium(cid) == TRUE and isPlayer(cid) == TRUE then

doPlayerSendTextMessage(cid,22,"You are premium. You may pass.")
doTransformItem(item.uid, item.itemid+1)

else

doTeleportThing(player.uid, pos, FALSE)
doPlayerSendTextMessage(cid,22,"Sorry, only Premium players are allowed to cross the bridge.")

end

end

end

function onStepOut(cid, item, pos)

if item.actionid == 3000 and item.itemid == 447 then

if isPremium(cid) == TRUE then

doTransformItem(item.uid, item.itemid-1)

end

end

end

the problem is that when I start up the server says this and you didnt fix it

could not los script premiumbridge.lua/>
[C]: in function 'getThingFromPos

If someone fix it please
 
PHP:
function onStepIn(cid, item, pos)
local pos = {x=1008, y=991, z=7, stackpos=1}
local player = getThingfromPos(cid)
	if item.actionid == 3000 and item.itemid == 446 then
		if isPremium(cid) == TRUE and isPlayer(cid) == TRUE then
			doPlayerSendTextMessage(cid,22,"You are premium. You may pass.")
			doTransformItem(item.uid, item.itemid+1)
		else
		doTeleportThing(cid, pos, FALSE)
		doPlayerSendTextMessage(cid,22,"Sorry, only Premium players are allowed to cross the bridge.")
		end
	end	
return TRUE
end

function onStepOut(cid, item, pos)
	if item.actionid == 3000 and item.itemid == 447 then
		if isPremium(cid) == TRUE then
			doTransformItem(item.uid, item.itemid-1)
		end
	end
return TRUE	
end

The whole script was bugged lol, try that one and report errors!
 
pitufo your script has the same error than the others =/
can someone make only the premium bridge script please and test it if it works ...
 
Put actionid 1002 on the level tile?
Code:
    Level Tile
        1000 + Required Level
And use this?
PHP:
function onStepIn(cid, item, frompos, item2, topos)
    if getPlayerLookDir(cid) == 0 then
        newdir = 2
    elseif getPlayerLookDir(cid) == 1 then
        newdir = 3
    elseif getPlayerLookDir(cid) == 2 then
        newdir = 0
    else
        newdir = 1
    end
    
    if item.uid == 1234 and isPremium(cid) == FALSE then
        doPlayerSendCancel(cid, "Sorry, only Premium players are allowed to cross the bridge.")
        doMoveCreature(cid, newdir)
    end
end
Sorry if this is wrong but I'm nooooob :wub:
 
Maybe this one works.

PHP:
function onStepIn(cid, item, pos)

local pos     = {x=1008, y=991, z=7, stackpos=1}

    if item.actionid == 3000 and item.itemid == 446 then

        if isPremium(cid) == TRUE and isPlayer(cid) == TRUE then

            doPlayerSendTextMessage(cid,22,"You are premium. You may pass.")
            doTransformItem(item.uid, item.itemid+1)

        else

            doTeleportThing(cid, pos, FALSE)
            doPlayerSendTextMessage(cid,22,"Sorry, only Premium players are allowed to cross the bridge.")

        end

    end

end

function onStepOut(cid, item, pos)

    if item.actionid == 3000 and item.itemid == 447 then

        if isPremium(cid) == TRUE then

            doTransformItem(item.uid, item.itemid-1)

        end

    end

end
 
mpa yes i did it i put it in movement.xml and the map editor but doesnt work, Oxious I will try yours again =)
 
Oxious yours works thanks and I dont remember who give me the lvl bridge working but I think you xD
Oxious I will rep you ^^
 
Back
Top