Hakeq
Banned
- Dołączył
- Marzec 23, 2013
- Posty
- 103
- Liczba reakcji
- 6
Autor: XenoChrist
NPC robi?cy clean co 30 sekund. Testowane na Evolutions i DevLandzie
Tworzymy plik cleaner.lua, wrzucamy go do data/npc/scripts i wklejamy do niego:
Teraz tworzymy Cleaner.xml i dajemy go do data/npc. Wrzucamy do niego to:
NPC robi?cy clean co 30 sekund. Testowane na Evolutions i DevLandzie
Tworzymy plik cleaner.lua, wrzucamy go do data/npc/scripts i wklejamy do niego:
Kod:
lastclean = 0
hasWarned = 0
focus = 0
talk_start = 0
target = 0
following = false
attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
end
function onCreatureTurn(creature)
end
function onCreatureSay(cid, type, msg)
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if lastclean == 0 then
lastclean = os.time()
end
if os.difftime(os.time(), lastclean) >= (29*60*60) and hasWarned == 0 then
selfSay('/B Clean in 1 minute! Take all yours items! Cleaning items in protection zone too!')
hasWarned = 1
end
if os.difftime (os.time(), lastclean) >= (30*60*60) then
selfSay('/clean')
selfSay('/B Clean completed, next clean in 30 minutes.')
lastclean = os.time()
end
end
Teraz tworzymy Cleaner.xml i dajemy go do data/npc. Wrzucamy do niego to:
Kod:
<?xml version="1.0"?>
<npc name="Cleaner" script="data/npc/scripts/cleaner.lua" access="5" autowalk="25">
<look type="153" head="94" body="57" legs="0" feet="0" addons="0" />
</npc>