What's new

Skrypt

XaNaduxD

Advanced User
Joined
Feb 13, 2009
Messages
193
Reaction score
13
Problem ze skryptem nie wie dlaczego nie dzia?a.



local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
local goku = {lookType=277}
local vegeta = {lookType=366}
local trunks = {lookType=334}
local gotenks = {lookType=333}
local gohan = {lookType=332}
local cell = {lookType=329}
local cooler = {lookType=325}
local c17 = {lookType=322}
local c18 = {lookType=328}
local uub = {lookType=335}
local buu = {lookType=5}
local frezer = {lookType=323}
local bardock = {lookType=327}
local brolly = {lookType=154}
local namekjin = {lookType=330}
local dende = {lookType=331}
local janemba = {lookType=324}
local tsuful = {lookType=326}

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
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)
msg = string.lower(msg)




if msgcontains(msg, 'hi') then

selfSay('Do you wanna change the brooch for legendary scroll?')
focus = cid
talk_start = os.clock()

end
end
elseif msgcontains(msg, 'Last Trans') or msgcontains(msg, 'Last') then
if getPlayerVocation(cid) == 206 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, goku)
doPlayerSetVocation(cid,400)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end

elseif getPlayerVocation(cid) == 219 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, vegeta)
doPlayerSetVocation(cid,401)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 226 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, trunks)
doPlayerSetVocation(cid,402)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 217 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, gotenks)
doPlayerSetVocation(cid,403)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 232 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, gotenks)
doPlayerSetVocation(cid,403)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 213 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, gohan)
doPlayerSetVocation(cid,404)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 279 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, cell)
doPlayerSetVocation(cid,405)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 325 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, cooler)
doPlayerSetVocation(cid,406)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 262 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, c17)
doPlayerSetVocation(cid,407)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 267 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, c18)
doPlayerSetVocation(cid,408)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 297 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, uub)
doPlayerSetVocation(cid,409)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 252 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, buu)
doPlayerSetVocation(cid,410)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 257 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, frezer)
doPlayerSetVocation(cid,411)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 291 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, bardock)
doPlayerSetVocation(cid,412)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 273 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, brolly)
doPlayerSetVocation(cid,413)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 241 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, namekjin)
doPlayerSetVocation(cid,414)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 302 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, dende)
doPlayerSetVocation(cid,415)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 312 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, janemba)
doPlayerSetVocation(cid,416)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
elseif getPlayerVocation(cid) == 264 then
if getPlayerLevel(cid) >= 350 then
doSetCreatureOutfit(cid, tsuful)
doPlayerSetVocation(cid,417)
talk_state = 0
else
selfSay('Sorry, you do not have enough level.')
talk_state = 0
end
else
selfSay('You are not have Transform. Or you must use "revert".')
talk_state = 0
end

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end

function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
 

Xayan

Senior User
Joined
Jul 4, 2009
Messages
2,608
Reaction score
390
Age
28
Odp: Skrypt

No a b??d jaki? Skrypt pojebanie napisany.
 

XaNaduxD

Advanced User
Joined
Feb 13, 2009
Messages
193
Reaction score
13
Odp: Skrypt

NPC kt?ry zmienia nam Outfit i Profesj?.
 
Top