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

Need help with this script

Joined
Sep 6, 2007
Messages
362
Reaction score
3
Everytime I load the server, it crashes, I think it's because of this script.

Does anyone know what's wrong?
It's supposed to remove 2 stones and give the player a storage ID when he walks in a specific portal.

local stonepos1 = {x=233, y=283, z=6}
local stonepos2 = {x=234, y=283, z=6}
local stone1 = getThingfromPos(stonepos1)
local stone2 = getThingfromPos(stonepos2)

function onStepIn(cid, item, pos)
if stone1.itemid == 1304 and stone2.itemid == 1304 then
if isPlayer(cid) == TRUE then
if getPlayerStorageValue(cid, 87878) == TRUE then
setPlayerStorageValue(cid, 86868, 1)
doRemoveItem(stone1.uid,1)
doRemoveItem(stone2.uid,1)
doSendMagicEffect(stonepos1, CONST_ME_POFF)
doSendMagicEffect(stonepos2, CONST_ME_POFF)
end
end
end
end
 
not sure if this is right, but try it

Code:
local stonepos1 = {x=233, y=283, z=6}
local stonepos2 = {x=234, y=283, z=6}
local stone1 = getThingfromPos(stonepos1)
local stone2 = getThingfromPos(stonepos2)

function onStepIn(cid, item, pos)
	if stone1.itemid == 1304 and stone2.itemid == 1304 and isPlayer(cid) == TRUE and getPlayerStorageValue(cid, 87878) == TRUE then
		setPlayerStorageValue(cid, 86868, 1)
		doRemoveItem(stone1.uid,1)
		doRemoveItem(stone2.uid,1)
		doSendMagicEffect(stonepos1, CONST_ME_POFF)
		doSendMagicEffect(stonepos2, CONST_ME_POFF)
		end
	end
end
 
function onStepIn(cid, item, pos)
local stonepos1 = {x=233, y=283, z=6}
local stonepos2 = {x=234, y=283, z=6}
local stone1 = getThingfromPos(stonepos1)
local stone2 = getThingfromPos(stonepos2)
if stone1.itemid == 1304 and stone2.itemid == 1304 and isPlayer(cid) == TRUE and getPlayerStorageValue(cid, 87878) == TRUE then
setPlayerStorageValue(cid, 86868, 1)
doRemoveItem(stone1.uid,1)
doRemoveItem(stone2.uid,1)
doSendMagicEffect(stonepos1, CONST_ME_POFF)
doSendMagicEffect(stonepos2, CONST_ME_POFF)
end
end
end
 
Tested and works.

PHP:
function onStepIn(cid, item, pos)
stonepos1 = {x=233, y=283, z=6, stackpos=1}
stonepos2 = {x=234, y=283, z=6, stackpos=1}
stone1 = getThingfromPos(stonepos1).uid
stone2 = getThingfromPos(stonepos2).uid
stchk1 = getThingfromPos(stonepos1)
stchk2 = getThingfromPos(stonepos2)
stoneID = 1304

    if isPlayer(cid) == TRUE then
        if (stchk1.itemid==stoneID) and (stchk2.itemid==stoneID) then
            if getPlayerStorageValue(cid, 87878) == TRUE then
                setPlayerStorageValue(cid, 86868, 1)
                doRemoveItem(stone1)
                doRemoveItem(stone2)
                doSendMagicEffect(stonepos1, CONST_ME_POFF)
                doSendMagicEffect(stonepos2, CONST_ME_POFF)    
            end
        end
    end
return TRUE
end
 
Last edited by a moderator:
Back
Top