function onUse(cid, item, fromPosition, itemEx, toPosition)
colours = {3, 10, 98, 114} -- Edit~
destinations = {
[colours[1]] = {x = 1020, y = 1035, z = 7, stackpos = 1},
[colours[2]] = {x = 1021, y = 1035, z = 7, stackpos = 1},
[colours[3]] = {x = 1019, y = 1035, z = 7, stackpos = 1},
[colours[4]] = {x = 1022, y = 1035, z = 7, stackpos = 1}
}
positions = {
[colours[1]] = {x = 1020, y = 1036, z = 7},
[colours[2]] = {x = 1021, y = 1036, z = 7},
[colours[3]] = {x = 1019, y = 1036, z = 7},
[colours[4]] = {x = 1022, y = 1036, z = 7}
}
zc = 0
for b=1, #colours do
if getCreatureOutfit(cid).lookFeet == colours[b] then
zc = 1
t = destinations[colours[b]]
r = positions[colours[b]]
end
end
if zc == 1 then
for i=1,252 do
superpos = r
superpos.stackpos = i
if getThingFromPos(superpos).itemid == 1387 then
doPlayerSendCancel(cid, "Your race has already created a portal.")
end
end
for i=1,252 do
for c, a in pairs(positions) do
sas = a
sas.stackpos = i
if getThingFromPos(sas).itemid == 1387 then
doRemoveItem(getThingFromPos(sas).uid)
end
end
end
doCreateTeleport(1387, t, r)
end
return 1
end