destroyer667
Member
- Joined
- Nov 21, 2007
- Messages
- 290
- Reaction score
- 6
I have this script and the Npc says "/save" but its not executed as a command he just says it in chat. how can i get the npc to execute this as a command? i have set the access of the npc to level 3 which the command is level 2
Lua:
<?xml version="1.0"?>
<npc name="saver" script="save.lua" autowalk="0" access="4">
<health now="150" max="150"/>
<look type="75" head="97" body="95" legs="114" feet="0"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. Welcome to Azuria!" />
<parameter key="message_farewell" value="Farewell, |PLAYERNAME|!" />
</parameters>
</npc>
Lua:
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) >= (1*60) and hasWarned == 0 then
selfSay('/save!')
hasWarned = 1
end
if os.difftime (os.time(), lastclean) >= (1*60) then
selfSay('/save')
lastclean = os.time()
end
end