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

Help with this NPC lines (LUA Code):

Nubaza

LUA Scripter
Joined
Jun 5, 2011
Messages
337
Solutions
1
Reaction score
23
Location
Chile
Hello! I have a problem :/

Code:
local this = getCreatureMaster(cid)
selfSay("Hello! You are full health!")
addEvent(doSetCreatureOutfit, 500, this, {lookType = 626}, 1000)
addEvent(doSetCreatureOutfit, 1000, this, {lookType = 627}, 1000)
addEvent(doSetCreatureOutfit, 1500, this, {lookType = 626}, 1000)
addEvent(doSetCreatureOutfit, 2000, this, {lookType = 181}, 1000)

With that code, the player will be change his outfit.. but i need this:

When the npc say Hello! You are full health! the NPC change his outfit with add event

I try with this line but don't work
Code:
addEvent(doSetCreatureOutfit, 1500, npc, {lookType = 626}, 1000)

Who can help me? D:
Thanks.
 
try again, test it
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic, Town = {}, {}

	local outfits = {
	[2] = {0,626,627,626,181}}
	
	creatureSayCallback(cid, outfits)
	return true
	end

 
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 thinkCallback(cid)
	if math.random(300) == 1 then
		npcHandler:say("Bye bye!")
	end
	return true
end
 
function creatureSayCallback(cid, type, msg, parameter, var)
	for i = 1, #parameter[1] do
	if (msgcontains(msg, "hello") or msgcontains(msg, "hi") and getCreatureMaxHealth(cid)) and (not npcHandler:isFocused(cid)) then
		local v, k = getPlayerVocation(cid), getCreatureName(cid)
			npcHandler:say("Hello! You are full health!", cid)
			Topic[cid] = nil
			local outfit = {lookType=parameter[2][i+1], lookHead=124, lookAddons=1, lookLegs=45, lookBody=1, lookFeet=87}
			doCreatureChangeOutfit(cid, outfit)
			npcHandler:say("I changed your outfit", cid)
		else
			npcHandler:say("Hello! You don't have full health!", cid)
			npcHandler:say("Come back when you have full your health.", cid)
			Topic[cid] = nil
		end
		Town[cid] = nil
		npcHandler:addFocus(cid)
	elseif(not npcHandler:isFocused(cid)) then
		return false
	elseif msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
		npcHandler:say("Bye, remember come back later.", cid, TRUE)
		Topic[cid] = nil
		Town[cid] = nil
		npcHandler:releaseFocus(cid)
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_WALKAWAY, "Sorry, come back later.")
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)

or this, have addEvent....

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
 
local Topic, Town = {}, {}

	local outfits = {
	[1] = {}},
	[2] = {0,626,627,626,181}}
	
	change(cid, outfits)
	return true
	end
	
function change(cid, parameter, var)
	for i = 1, #parameter[1] do
		local outfit = {lookType=parameter[2][i+1], lookHead=124, lookAddons=1, lookLegs=45, lookBody=1, lookFeet=87}
		doCreatureChangeOutfit(cid, outfit)
	end
 
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 thinkCallback(cid)
	if math.random(300) == 1 then
		npcHandler:say("Bye bye!")
	end
	return true
end
 
function creatureSayCallback(cid, type, msg)
	if (msgcontains(msg, "hello") or msgcontains(msg, "hi") and getCreatureMaxHealth(cid)) and (not npcHandler:isFocused(cid)) then
		local v, k = getPlayerVocation(cid), getCreatureName(cid)
		local this = getCreatureMaster(cid)
			npcHandler:say("Hello! You are full health!", cid)
			Topic[cid] = nil
			addEvent(cid,change,this)
			npcHandler:say("I changed your outfit", cid)
		else
			npcHandler:say("Hello! You don't have full health!", cid)
			npcHandler:say("Come back when you have full your health.", cid)
			Topic[cid] = nil
		end
		Town[cid] = nil
		npcHandler:addFocus(cid)
	elseif(not npcHandler:isFocused(cid)) then
		return false
	elseif msgcontains(msg, "bye") or msgcontains(msg, "farewell") then
		npcHandler:say("Bye, remember come back later.", cid, TRUE)
		Topic[cid] = nil
		Town[cid] = nil
		npcHandler:releaseFocus(cid)
	end
	return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_WALKAWAY, "Sorry, come back later.")
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
 
Last edited:
Omg, sorry man, that script send me various types of error in my TFS 0.3.6

And i need that the NPC change his outfit, not the npc change the outfit of the player...
I will send my full script:

Nurse Joy.lua
Code:
local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local talkState = {}
local states = {'1', '2', '3', '4', '5', '6'}
local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066,  1067, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}
local unlock = {}
local pokeballs = {'2222', '2224'}
local ultraballs = {'2220', '2227'}
local superballs = {'4430', '4432'}
local greatballs = {'3250', '3252'}
local loverballs = {'3253', '3255'}
local darkballs = {'3256', '3258'}
local cloudballs = {'3259', '3261'}
local goldenballs = {'3268', '3270'}
local saffariballs = {'3273', '3275'}
local masterballs = {'203', '202'}
local hyperballs = {'237', '213'}
local uniqueballs = {'217', '219'}
local unigreatballs = {'214', '216'}

function onThingMove(creature, thing, oldpos, oldstackpos)



end





function onCreatureAppear(creature)



end





function onCreatureDisappear(cid, pos)
	if focus == cid then

selfSay('Good bye sir!')

focus = 0

talk_start = 0

	end

end





function onCreatureTurn(creature)



end





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 onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if (msgcontains(msg, 'hi')) and getDistanceToCreature(cid) < 5 then
        if #getCreatureSummons(cid) >= 1 then
        return selfSay('Please back your Pokemon to the pokeball...')
        end
        if getPlayerStorageValue(cid, 17001) == 1 then       
        return selfSay('I cant heal your Pokemons if you are riding.')              
        end
        if getPlayerStorageValue(cid, 5700) == 1 then       
        return selfSay('I cant heal your Pokemons if you are mounted in a bike.')              
        end
        if getPlayerStorageValue(cid, 17000) == 1 then
        return selfSay('I cant heal your Pokemons if you are flying.')
        end
        if not getTilePzInfo(getPlayerPosition(cid)) then
        return selfSay('Please enter in the Pokemon Center...')
        end
	doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
	doSendMagicEffect(getThingPos(cid), 14)
	if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 2222)
	end
	if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 2220)
	end
	if isInArray(superballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 4430)
	end
	if isInArray(greatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 3250)
	end
	if isInArray(loverballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 3253)
	end
	if isInArray(darkballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 3256)
	end
	if isInArray(cloudballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 3259)
	end
	if isInArray(goldenballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 3268)
	end
	if isInArray(saffariballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 3273)
	end
	if isInArray(masterballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 203)
	end
	if isInArray(hyperballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 237)
	end
	if isInArray(uniqueballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 217)
	end
	if isInArray(unigreatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
	local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
	local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
	doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
	doTransformItem(feet.uid, 214)
	end
		local bp = getPlayerSlotItem(cid, CONST_SLOT_AMMO)
			if #getCreatureSummons(cid) >= 1 then
			local jui = getCreatureSummons(cid)[1]
			doCreatureAddHealth(jui, getCreatureMaxHealth(jui)-getCreatureHealth(jui))
			doSendMagicEffect(getThingPos(jui), 14)
			end
			local items = getItemsInContainerById(bp.uid, 2224)
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 2222)
			end
			local items = getItemsInContainerById(bp.uid, 2227) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 2220)
			end
			local items = getItemsInContainerById(bp.uid, 4432) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 4430)
			end
			local items = getItemsInContainerById(bp.uid, 3252) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 3250)
			end
			local items = getItemsInContainerById(bp.uid, 3255) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 3253)
			end
			local items = getItemsInContainerById(bp.uid, 3258) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 3256)
			end
			local items = getItemsInContainerById(bp.uid, 3261) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 3259)
			end
			local items = getItemsInContainerById(bp.uid, 3270) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 3268)
			end
			local items = getItemsInContainerById(bp.uid, 3275) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 3273)
			end
			local items = getItemsInContainerById(bp.uid, 202) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 203)
			end
			local items = getItemsInContainerById(bp.uid, 213) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 237)
			end
			local items = getItemsInContainerById(bp.uid, 219) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 217)
			end
			local items = getItemsInContainerById(bp.uid, 216) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			doTransformItem(uid, 214)
			end
			local items = getItemsInContainerById(bp.uid, 2222) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 2220) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 4430) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 3250) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 3253) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 3256) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 3259) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 3268) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 3273) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 203) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 237) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 217) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
			local items = getItemsInContainerById(bp.uid, 214) 
			for _, uid in pairs(items) do
			local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
			doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
			end
local this = getCreaturePosition(cid)
selfSay("Hello! We've restored your Pokemon to full health. We hope to see you again!")
addEvent(doSetCreatureOutfit, 500, cid, {lookType = 626}, 500)
addEvent(doSetCreatureOutfit, 1000, cid, {lookType = 627}, 500)
addEvent(doSetCreatureOutfit, 1500, cid, {lookType = 626}, 500)
addEvent(doSetCreatureOutfit, 2000, cid, {lookType = 181}, 500)
end
end
 
function onThink()

if focus ~= 0 then
a, b, c = selfGetPosition()
if c ~= getThingPos(focus).z then
focus = 0
end
end

if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
focus = 0
end
end

return true
end

That it's the code.
Can you help me? thanks x.x
 
Back
Top