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

Pints of inferno! HELP!

Seq

Banned User
Joined
May 6, 2009
Messages
87
Reaction score
0
Location
Poland
Lua:
function onStepIn(cid, item, pos)
    if item.uid == 22222 and item.itemid == 471 then
        if getPlayerStorageValue(cid,10001) == 1 or getPlayerStorageValue(cid,10002) == 1 or getPlayerStorageValue(cid,10003) == 1 or getPlayerStorageValue(cid,10004) == 1 or getPlayerStorageValue(cid,10005) == 1 or getPlayerStorageValue(cid,10007) then
			local pos = {x=1313, y=1147, z=14}
			doTeleportThing(cid,pos)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
			local pos2 = {x=1313, y=1152, z=14}
			doTeleportThing(cid,pos2)
        end
    end
    return 1
end

That script teleporting everyone who stand on item.id 471, can someone change it?
I wants that only teleport if player get StorageValue .

Pls help :)
 
u got mistake in this script on that part

Code:
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
                        local pos2 = {x=1313, y=1152, z=14}
                        doTeleportThing(cid,pos2)

this else means if someone haven't this storage value will do the following
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
and
doTeleportThing(cid,pos2)

and as u know it should give him the message only not to teleport him aswell :D

So the right script is going to be

Code:
  function onStepIn(cid, item, pos)
    if item.uid == 22222 and item.itemid == 471 then
        if getPlayerStorageValue(cid,10001) == 1 or getPlayerStorageValue(cid,10002) == 1 or getPlayerStorageValue(cid,10003) == 1 or getPlayerStorageValue(cid,10004) == 1 or getPlayerStorageValue(cid,10005) == 1 or getPlayerStorageValue(cid,10007) then
                        local pos = {x=1313, y=1147, z=14}
                        doTeleportThing(cid,pos)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
                        
        end
    end
    return 1
end

That will teleport the players who havethe storage value and will not teleport who dont have it this is if it's ok to step on the tile

if u want it as teleporting the player who have the storage to place number 1 and teleport the one who have not back to place number 2 <place number 2 here means the place that he will be teleported back> the script should be like

Code:
  function onStepIn(cid, item, pos)
    if item.uid == 22222 and item.itemid == 471 then
        if getPlayerStorageValue(cid,10001) == 1 or getPlayerStorageValue(cid,10002) == 1 or getPlayerStorageValue(cid,10003) == 1 or getPlayerStorageValue(cid,10004) == 1 or getPlayerStorageValue(cid,10005) == 1 or getPlayerStorageValue(cid,10007) then
                        local pos = {x=1313, y=1147, z=14}
                        doTeleportThing(cid,pos)
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
                        local pos2 = {x=xxxx, y=xxxx, z=xx}
                        doTeleportThing(cid,pos2)
        end
    end
    return 1
end

in this local pos2 = {x=xxxx, y=xxxx, z=xx} add the place u want to get teleported back if u dont have the storage value

Sorry about my english or long explanation
If that helped you give me some Rep++ in return :p
 
Back
Top