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

Lua Npc Help ! should be easy.

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
 
I've searched all related threads on OTfans ranging from 2007 to 2010, and this doesn't seem to be working for anyone. maybe only in very old servers like yurots.
 
i tried finding a Talkaction script that i can save with like "!save" and have the npc do it like that i just cant find a talkaction script that works and saves houses players and stuff
 
well i compiled it in take a look at my other thread about auto saving avesta i get an error when i compile the code in. that is why i tried using a npc instead.
 
Back
Top Bottom