Shiko Erye
LUA - Scripter
- Joined
- Dec 7, 2010
- Messages
- 106
- Reaction score
- 12
LUA:
local tp_wait_time = -300
local viridian = {x=707, y=1089, z=7}
local pewter = {x=718, y=858, z=6}
local cerulean = {x=1060, y=904, z=7}
local saffron = {x=1054, y=1049, z=7}
local celadon = {x=863, y=1036, z=6}
local lavender = {x=1204, y=1045, z=7}
local vermilion = {x=1072, y=1167, z=7}
local fuchsia = {x=1213, y=1324, z=7}
local cinnabar = {x=776, y=1270, z=7}
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onSay(cid, type, msg)
msg = string.lower(msg)
local pokes = {
['Abra'] = {1},
['Kadabra'] = {1},
['Alakazam'] = {1},
['Drowzee'] = {1},
['Hypno'] = {1},
['Porygon'] = {1},
['Mew'] = {1},
['Mewtwo'] = {1},
['Rattata'] = {1},
}
local poketp = getCreatureName(getCreatureSummons(cid)[1])
if pokes[poketp] then
if (os.clock() - tp_wait_time) >=300 then
if msgcontains(msg, 'tp"viridian') then
doCreatureSay(cid,poketp.." teleport to Viridian.", 1)
doTeleportThing(cid, viridian)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"pewter') then
doCreatureSay(cid,poketp.." teleport to Pewter.", 1)
doTeleportThing(cid, pewter)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"cerulean') then
doCreatureSay(cid,poketp.." teleport to Cerulean.", 1)
doTeleportThing(cid, cerulean)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"saffron') then
doCreatureSay(cid,poketp.." teleport to Saffron.", 1)
doTeleportThing(cid, saffron)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"celadon') then
doCreatureSay(cid,poketp.." teleport to Celadon.", 1)
doTeleportThing(cid, celadon)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"lavender') then
doCreatureSay(cid,poketp.." teleport to Lavender.", 1)
doTeleportThing(cid, lavender)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"vermilion') then
doCreatureSay(cid,poketp.." teleport to Vermilion.", 1)
doTeleportThing(cid, vermilion)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"cinnabar') then
doCreatureSay(cid,poketp.." teleport to Cinnabar.", 1)
doTeleportThing(cid, cinnabar)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
elseif msgcontains(msg, 'tp"fuchsia') then
doCreatureSay(cid,poketp.." teleport to Fuchsia.", 1)
doTeleportThing(cid, fuchsia)
doSendMagicEffect(1,10)
tp_wait_time = os.clock()
else
doPlayerSendTextMessage(cid,27, "This place doesn't exist.")
end
else
return doPlayerSendTextMessage(cid,27,"Sorry, you have to wait " ..(300-(os.clock() - tp_wait_time)).. " seconds.")
end
else
doCreatureSay(cid,"This pokemon can't use teleport.", 1)
end
end
Last edited: