Jump to content
Sign in to follow this  
TheSamurai

NPC that will give quest in time

Recommended Posts

Can someone help me to have a npc that will give player a quest when the time is 1AM - 3AM abd 1PM to 3PM. 

 

I tried this but it seems its not working well,

 

function NpcTime (role)

local npc_time = os.date(%H)

npc_time = to.number(npc_time)

if npc_time =>13 and npc_time <15 then

return LUA_TRUE

end

end

 

I think ill not post the missionsdk scripts too since the one i posted is the main problem i think. I hope someone can help me thank you. 

Edited by TheSamurai

Share this post


Link to post
Share on other sites

I will write/release a set of handlers for these type of conditional functions soon.
But by examining your code, couple things:
 os.date(%H) -> os.date("%H")
to.number -> tonumber


kong.png

a2.png

Share this post


Link to post
Share on other sites
Guest
function NpcTime ( role )
local npc_time = os.date("%H")
npc_time = tonumber(npc_time)
	if npc_time > 13 and npc_time < 15 then
		return LUA_TRUE
	end
end

Try this.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...