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

Solved Yalahar gate help

gunmetal

New Member
Joined
Oct 15, 2007
Messages
75
Reaction score
0
Im a big noob at this..I have this function but im not sure where to put it also can somone correct me if im wrong?In actions xml i should have something like this?

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 

local config = {
gates = {
    [1930] = {{x=100,y=100,z=7}, CONST_ME_TELEPORT},  -- [uid] = {{pos}, effect}
    [1931] = {{x=100,y=100,z=7}, CONST_ME_TELEPORT},
    [1932] = {{x=100,y=100,z=7}, CONST_ME_TELEPORT},
    [1933] = {{x=100,y=100,z=7}, CONST_ME_TELEPORT},
    [1934] = {{x=100,y=100,z=7}, CONST_ME_TELEPORT},
    [1935] = {{x=100,y=100,z=7}, CONST_ME_TELEPORT}
},
text = "You are worthy enought to pass."
}
    for type, variable in pairs(config.gates) do
        if item.uid == type then
            doTeleportThing(cid, variable[1])
            doSendMagicEffect(variable[1], variable[2])
            doPlayerSendTextMessage(cid, 22, config.text) 
        end
    end  
    return TRUE
end

also can somone correct me if im wrong?In actions xml i should have something like this for each gate?

PHP:
<action uniqueid=" blah blah" script="quests/multigate.lua"/>
 
i have another issue, its not workin :/ it just says you cannot use this object. Do i need to set the action ID to something? i have the unique ids set correct

i put it under quests like you said as well. double checked it
 
PHP:
<action fromuid="1930" touid="1935" script="tools/multigate.lua"/>

Just like that

I have the script in the tools folder.

No errors at all in the console

heres the script with positions

PHP:
function onUse(cid, item, fromPosition, itemEx, toPosition) 

local config = {
gates = {
    [1930] = {{x=2476,y=840,z=5}, CONST_ME_TELEPORT},  -- [uid] = {{pos}, effect}
    [1931] = {{x=2492,y=799,z=5}, CONST_ME_TELEPORT},
    [1932] = {{x=2524,y=779,z=5}, CONST_ME_TELEPORT},
    [1933] = {{x=2621,y=840,z=5}, CONST_ME_TELEPORT},
    [1934] = {{x=2602,y=891,z=5}, CONST_ME_TELEPORT},
    [1935] = {{x=2582,y=908,z=5}, CONST_ME_TELEPORT}
},
text = "You are worthy enought to pass."
}
    for type, variable in pairs(config.gates) do
        if item.uid == type then
            doTeleportThing(cid, variable[1])
            doSendMagicEffect(variable[1], variable[2])
            doPlayerSendTextMessage(cid, 22, config.text) 
        end
    end  
    return TRUE
end

im using tfs 0.214 9.6 protocol
 
I fixed it, it worked out ok just used a cleaner script.

PHP:
local t = {
	[1930] = {x=2476,y=840,z=5},
	[1931] = {x=2492,y=799,z=5},
	[1932] = {x=2524,y=779,z=5},
	[1933] = {x=2621,y=840,z=5},
	[1934] = {x=2602,y=891,z=5},
	[1935] = {x=2582,y=908,z=5},
	[1936] = {x=2482,y=840,z=5},
	[1937] = {x=2493,y=804,z=5},
	[1938] = {x=2524,y=785,z=5},
	[1939] = {x=2615,y=839,z=5},
	[1940] = {x=2602,y=886,z=5},
	[1941] = {x=2582,y=905,z=5},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local tmp = getThingPos(cid)
	doTeleportThing(cid, t[item.uid])
	doSendMagicEffect(tmp, CONST_ME_TELEPORT)
	doSendMagicEffect(t[item.uid], CONST_ME_TELEPORT)
	return true
end

Rep for the people that gave me support! Thanks everyone
 
Back
Top