LuaScripter
Scripter -Lua-
- Joined
- Jan 16, 2012
- Messages
- 40
- Reaction score
- 1
I will respond to the request as soon as possible, I will fix the problem. The best part about it is that this service is free for you!
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end
--------------------------------------------------------------------
local talk = {}
local num = 0
local messages =
{
[1] = "Que estupendo dia para pescar!",
[2] = "Espero pescar un tiburon!"
}
------------------------------------------------------------------
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'fishing rod'}, 2580, 32, 'fishing rod')
shopModule:addBuyableItem({'fish'}, 2667, 8, 'fish')
------------------------------------------------------------------
npcHandler:setMessage(MESSAGE_GREET, 'Buenasss |PLAYERNAME|!!')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Adios |PLAYERNAME|!!')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Mmm, adios!')
npcHandler:setMessage(MESSAGE_IDLETIMEOUT, 'Mmmm, te quedaste mudo?')
npcHandler:setMessage(MESSAGE_SENDTRADE, 'Te puedo vender una cana de pescar para que te unas a tan apasionante deporteeee! Lo que si es que te faltarian los gusanitos de carnada.. no te pienso dar los mios!')
npcHandler:setMessage(MESSAGE_ONCLOSESHOP, 'Jejeje graciasss!')
-------------------------------------------------------------------
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
talk[cid] = talk[cid] or 0
if talk[cid] == 0 and (msgcontains(msg, "info") or msgcontains(msg, "news")) then
selfSay("Esta es la playa, y mi hobbie en ella es, por supuesto, pasarmela aqui de pesca. :)", cid)
return true
end
if talk[cid] == 0 and (msgcontains(msg, "quest") or msgcontains(msg, "mission")) then
selfSay("Yo no necesito nada, gracias!", cid)
return true
end
if talk[cid] == 0 and msgcontains(msg, "job") then
selfSay("Soy un pescador apasionado!", cid)
return true
end
return true
end
------*************************************************************************************-------------
function onThinkCallback()
num = num + 1
if num >= math.random(25, 30) then
local random = math.random(1, #messages)
doCreatureSay(getNpcCid(), messages[random], TALKTYPE_SAY)
num = 0
end
return true
end
------*************************************************************************************-------------
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink(cid, interval) npcHandler:onThink(interval) end
function onPlayerEndTrade(cid) npcHandler:onPlayerEndTrade(cid) end
function onPlayerCloseChannel(cid) npcHandler:onPlayerCloseChannel(cid) end
--------------------------------------------------------------------
local talk = {}
local num = 0
local messages =
{
[1] = "Que estupendo dia para pescar!",
[2] = "Espero pescar un tiburon!"
}
------------------------------------------------------------------
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'fishing rod'}, 2580, 32, 'fishing rod')
shopModule:addBuyableItem({'fish'}, 2667, 8, 'fish')
------------------------------------------------------------------
npcHandler:setMessage(MESSAGE_GREET, 'Buenasss |PLAYERNAME|!!')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Adios |PLAYERNAME|!!')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Mmm, adios!')
npcHandler:setMessage(MESSAGE_IDLETIMEOUT, 'Mmmm, te quedaste mudo?')
npcHandler:setMessage(MESSAGE_SENDTRADE, 'Te puedo vender una cana de pescar para que te unas a tan apasionante deporteeee! Lo que si es que te faltarian los gusanitos de carnada.. no te pienso dar los mios!')
npcHandler:setMessage(MESSAGE_ONCLOSESHOP, 'Jejeje graciasss!')
-------------------------------------------------------------------
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
talk[cid] = talk[cid] or 0
if talk[cid] == 0 and (msgcontains(msg, "info") or msgcontains(msg, "news")) then
selfSay("Esta es la playa, y mi hobbie en ella es, por supuesto, pasarmela aqui de pesca. :)", cid)
return true
end
if talk[cid] == 0 and (msgcontains(msg, "quest") or msgcontains(msg, "mission")) then
selfSay("Yo no necesito nada, gracias!", cid)
return true
end
if talk[cid] == 0 and msgcontains(msg, "job") then
selfSay("Soy un pescador apasionado!", cid)
return true
end
return true
end
------*************************************************************************************-------------
function onThinkCallback()
num = num + 1
if num >= math.random(25, 30) then
local random = math.random(1, #messages)
doCreatureSay(getNpcCid(), messages[random], TALKTYPE_SAY)
num = 0
end
return true
end
------*************************************************************************************-------------
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 4006 then
doTransformItem(item.uid,4008)
doSummonMonster(cid, "Crazy Monkey")
-- need the countdown function?
doDecayItem(item.uid,4006)
end
return 1
end
function onUse(cid, item, frompos, item2, topos)
if item.actionid == 33333 and getPlayerItemCount(cid, 10123) >= 1 then
doRemoveItem(cid,10123,1)
doTransformItem(item.uid,489)
Need the countdown part...can't seem to find the function for it
doDecayItem(item.uid,231)
end
return 1
end
Can anyone create an Donated UH script for me min 2000 max 2500
local trainingRoom = {
[1] = {x = 1000, y = 1000, z = 7, stackpos = 255},
[2] = {x = 1000, y = 1000, z = 7, stackpos = 255},
[2] = {x = 1000, y = 1000, z = 7, stackpos = 255},
[4] = {x = 1000, y = 1000, z = 7, stackpos = 255}
}
local level_to_train = 10
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if getPlayerLevel(cid) >= level_to_train then
if isInArray(trainingRoom) then
---------------------Room 1----------------------
if (not isPlayer(trainingRoom[1])) then
doTeleportThing(cid, trainingRoom[1])
doPlayerSendTextMessage(cid, "Welcome to you're training room.")
else
---------------------Room 2----------------------
if (not isPlayer(trainingRoom[2])) then
doTeleportThing(cid, trainingRoom[2])
doPlayerSendTextMessage(cid, "Welcome to you're training room.")
else
---------------------Room 3----------------------
if (not isPlayer(trainingRoom[3])) then
doTeleportThing(cid, trainingRoom[3])
doPlayerSendTextMessage(cid, "Welcome to you're training room.")
else
---------------------Room 4----------------------
if (not isPlayer(trainingRoom[4])) then
doTeleportThing(cid, trainingRoom[4])
doPlayerSendTextMessage(cid, "Welcome to you're training room.")
else
doPlayerSendCancel(cid, "all training rooms are full!")
doTeleportThing(cid, fromPos, true)
return false
end
end
end
end
end
else
doPlayerSendCancel(cid, "You are not high enough level to train!")
doTeleportThing(cid, fromPos, true)
return false
end
end