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

Mystic Flame;Coal Basin (Help)

SasirO

Banned User
Joined
Apr 30, 2009
Messages
559
Reaction score
0
well, its a script from tfs 0.2, however its not working on crying~ 0.3.2, any ideas?

PHP:
function onStepIn(cid, item, pos, fromPosition)

	if item.uid == 60063 then
		local coin = getThingfromPos({x=33073,y=32589,z=13,stackpos=2})
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33073,y=32589,z=13}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33079,y=32589,z=13}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif item.uid == 60065 then
		coin = {x=33098,y=32816,z=13,stackpos=2}
		getcoin = getThingfromPos(coin)
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33098,y=32816,z=13}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33093,y=32824,z=13})
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif item.uid == 60067 then
		local coin = getThingfromPos({x=33135,y=32682,z=12,stackpos=2})
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33135,y=32682,z=12}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33130,y=32683,z=12}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif item.uid == 60069 then
		local coin = getThingfromPos({x=33161,y=32831,z=10,stackpos=2})
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33161,y=32831,z=10}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33156,y=32832,z=10}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif item.uid == 60071 then
		local coin = getThingfromPos({x=33233,y=32692,z=13,stackpos=2})
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33233,y=32692,z=13}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33234,y=32687,z=13}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif item.uid == 60073 then
		local coin = getThingfromPos({x=33240,y=32855,z=13,stackpos=2})
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33240,y=32855,z=13}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33246,y=32850,z=13}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif item.uid == 60075 then
		local coin = getThingfromPos({x=33276,y=32552,z=14,stackpos=2})
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33276,y=32552,z=14}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33271,y=32553,z=14}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
	elseif item.uid == 60077 then
		local coin = getThingfromPos({x=33293,y=32741,z=13,stackpos=2})
		if coin.itemid == 2159 and coin.type >= 1 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect({x=33293,y=32741,z=13}, CONST_ME_HITBYFIRE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, {x=33299,y=32742,z=13}, FALSE)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
		end
return TRUE
end
 
Code:
function onStepIn(cid, item, pos, fromPosition)

    if item.uid == 60063 then
        local coin = getThingFromPos({x=33073,y=32589,z=13,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33073,y=32589,z=13}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33079,y=32589,z=13}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    elseif item.uid == 60065 then
        coin = {x=33098,y=32816,z=13,stackpos=2}
        getcoin = getThingFromPos(coin)
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33098,y=32816,z=13}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33093,y=32824,z=13})
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    elseif item.uid == 60067 then
        local coin = getThingFromPos({x=33135,y=32682,z=12,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33135,y=32682,z=12}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33130,y=32683,z=12}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    elseif item.uid == 60069 then
        local coin = getThingFromPos({x=33161,y=32831,z=10,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33161,y=32831,z=10}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33156,y=32832,z=10}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    elseif item.uid == 60071 then
        local coin = getThingFromPos({x=33233,y=32692,z=13,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33233,y=32692,z=13}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33234,y=32687,z=13}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    elseif item.uid == 60073 then
        local coin = getThingFromPos({x=33240,y=32855,z=13,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33240,y=32855,z=13}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33246,y=32850,z=13}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    elseif item.uid == 60075 then
        local coin = getThingFromPos({x=33276,y=32552,z=14,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33276,y=32552,z=14}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33271,y=32553,z=14}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    elseif item.uid == 60077 then
        local coin = getThingFromPos({x=33293,y=32741,z=13,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33293,y=32741,z=13}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33299,y=32742,z=13}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    end
return TRUE
end

Try now ;]
 
do you think that an end will help? NO
if it would be so easy then i could fix it my self ;) im getting no errors in the console also.
 
do you think that an end will help? NO
if it would be so easy then i could fix it my self ;) im getting no errors in the console also.

LUA:
getCreaturePosition(cid)
change to
LUA:
getPlayerPosition(cid)
and
LUA:
end
before return TRUE
 
Last edited:
do you think that an end will help? NO
if it would be so easy then i could fix it my self ;) im getting no errors in the console also.

LUA:
getCreaturePosition(cid)
change to
LUA:
getPlayerPosition(cid)
and
LUA:
end
before return TRUE


and instead using:
LUA:
function onStepIn(cid, item, pos, fromPosition)

    if item.uid == 60063 then
        local coin = getThingFromPos({x=33073,y=32589,z=13,stackpos=2})
        if coin.itemid == 2159 and coin.type >= 1 then
            doRemoveItem(coin.uid, 1)
            doSendMagicEffect({x=33073,y=32589,z=13}, CONST_ME_HITBYFIRE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
            doTeleportThing(cid, {x=33079,y=32589,z=13}, FALSE)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
        end
    end
return TRUE
end
you can use:
LUA:
function onStepIn(cid, item, pos, fromPosition) 
pos = {
{x=33073,y=32589,z=13,stackpos=2}
}
if item.uid == 60063 then
	coin = getThingfromPos()
	if coin.itemid == 2159 then
		doRemoveItem(coin.uid, 1)
		doSendMagicEffect(pos[1], CONST_ME_HITBYFIRE)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
		doTeleportThing(cid, pos[1])
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
	end
end
return TRUE
end
 
Script Ive written sometime ago for ankrahmun tombs, it could be shorter but w/e.

basins.lua
LUA:
local altars = {
	{ x = 33240, y = 32855, z = 13, stackpos = 255 },
	{ x = 33233, y = 32692, z = 13, stackpos = 255 },
	{ x = 33098, y = 32816, z = 13, stackpos = 255 },
	{ x = 33293, y = 32741, z = 13, stackpos = 255 },
	{ x = 33135, y = 32682, z = 12, stackpos = 255 },
	{ x = 33276, y = 32552, z = 14, stackpos = 255 }
}

local oldPos = {
	{ x = 33240, y = 32856, z = 13, stackpos = 255 },
	{ x = 33234, y = 32692, z = 13, stackpos = 255 },
	{ x = 33097, y = 32816, z = 13, stackpos = 255 },
	{ x = 33293, y = 32742, z = 13, stackpos = 255 },
	{ x = 33135, y = 32683, z = 12, stackpos = 255 },
	{ x = 33276, y = 32553, z = 14, stackpos = 255 }
}

local newPos = {
	{ x = 33246, y = 32851, z = 13 },
	{ x = 33234, y = 32685, z = 13 },
	{ x = 33093, y = 32825, z = 13 },
	{ x = 33300, y = 32742, z = 13 },
	{ x = 33129, y = 32683, z = 12 },
	{ x = 33270, y = 32553, z = 14 }
}

function onAddItem(moveitem, tileitem, pos)
	local altar = 0

	for i = 1, #altars do
		if comparePositions(pos, altars[i]) == TRUE then
			altar = i
			break
		end
	end
	
	if altar == 0 then
		return TRUE
	end

	if(getThingFromPos(oldPos[altar]).uid > 0) then
		doTeleportThing(getThingFromPos(oldPos[altar]).uid, newPos[altar], FALSE)
	end

	doRemoveItem(moveitem.uid)
	doSendMagicEffect(oldPos[altar], CONST_ME_TELEPORT)
	return TRUE
end
mystic flame.lua
LUA:
local flames = {
	[1] = { { x = 33272, y = 32553, z = 14, stackpos = 255 }, { x = 33278, y = 32553, z = 14 } }
}

function onStepIn(cid, item, pos)
	for _, positions in pairs(flames) do
		if comparePositions(pos, positions[1]) == TRUE then
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, positions[2], FALSE)
			break
		end
	end
	
	return TRUE
end

also, comparePositions function:
LUA:
function comparePositions(pos1, pos2)
	if(pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z) then
		return TRUE
	end
	
	return FALSE
end
 
@teckman

LUA:
function onStepIn(cid, item, pos, fromPosition)
	pos = {
		{x=33073,y=32589,z=13,stackpos=2}
	}
	--[[
		Why double array ? =S
		should be
		local pos = {x = 33073, y = 32589, z = 13, stackpos = 2}
		and please use a space after a "," and before/after a "=", make script better to read.
	]]
	if item.uid == 60063 then
		coin = getThingfromPos()
		--[[
			no pos ? getThingfromPos(no pos ?)
			should be
			local coin = getThingfromPos(pos)
		]]
		if coin.itemid == 2159 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect(pos[1], CONST_ME_HITBYFIRE)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, pos[1])
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
			--[[
				Blah blah
				pos[1] useless
				doRemoveItem(coin.uid, 1)
				doSendMagicEffect(pos, CONST_ME_HITBYFIRE)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
				doTeleportThing(cid, pos)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
			]]
		end
	end
	return TRUE
end

--And please tab the codes
 
@teckman

LUA:
function onStepIn(cid, item, pos, fromPosition)
	pos = {
		{x=33073,y=32589,z=13,stackpos=2}
	}
	--[[
		Why double array ? =S
		should be
		local pos = {x = 33073, y = 32589, z = 13, stackpos = 2}
		and please use a space after a "," and before/after a "=", make script better to read.
	]]
	if item.uid == 60063 then
		coin = getThingfromPos()
		--[[
			no pos ? getThingfromPos(no pos ?)
			should be
			local coin = getThingfromPos(pos)
		]]
		if coin.itemid == 2159 then
			doRemoveItem(coin.uid, 1)
			doSendMagicEffect(pos[1], CONST_ME_HITBYFIRE)
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
			doTeleportThing(cid, pos[1])
			doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
			--[[
				Blah blah
				pos[1] useless
				doRemoveItem(coin.uid, 1)
				doSendMagicEffect(pos, CONST_ME_HITBYFIRE)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
				doTeleportThing(cid, pos)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_TELEPORT)
			]]
		end
	end
	return TRUE
end

--And please tab the codes
@Nahurto

The double array is for multi coords. (rly that hard to understand?)
I won't make space after "," and "=", becouse of some morons from otland. K?
getThingfromPos(pos[1]) -- just forgot
And for the conclusion, I tabbed this code. :)
 
Back
Top