Jump to content
Sign in to follow this  
gunnapong

Create Quest Time

Recommended Posts

 

I want to create a timed quest for the quest to be available during this time.  Can do a quest for 15 minutes and then the quest disappears, can't be done.  sorry for my english 

Help me plz Tank.

 

 

 

Share this post


Link to post
Share on other sites
function CheckTime ( Player )
	local Now_Week = os.date("%w")
	local Now_Hour = os.date("%H")
	Now_Week = tonumber(Now_Week)
	Now_Hour = tonumber(Now_Hour)
	if Now_Week == 6 or Now_Week == 0 then
		if Now_Hour >= 9 and Now_Hour < 12 then
			return LUA_TRUE
		elseif Now_Hour >= 21 then
			return LUA_TRUE
		end
	end
end

you can use the CheckTime condition

MissionSdk.lua

			elseif conditions[i].func ==CheckTime then
				PRINT( "ConditionsTest: CheckTime, p1 =, p2 =", conditions[i].p1)
				local ret = CheckTime( character, conditions[i].p1 )
				if ret ~= LUA_TRUE then
					PRINT( "ConditionsTest:CheckTime = false" )
					return LUA_FALSE
				end

way of use.

MisBeginCondition(CheckTime)

 


Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites
4 minutes ago, 1g0rS1lv4 said:

function CheckTime ( Player )
	local Now_Week = os.date("%w")
	local Now_Hour = os.date("%H")
	Now_Week = tonumber(Now_Week)
	Now_Hour = tonumber(Now_Hour)
	if Now_Week == 6 or Now_Week == 0 then
		if Now_Hour >= 9 and Now_Hour < 12 then
			return LUA_TRUE
		elseif Now_Hour >= 21 then
			return LUA_TRUE
		end
	end
end

you can use the CheckTime condition

MissionSdk.lua


			elseif conditions[i].func ==CheckTime then
				PRINT( "ConditionsTest: CheckTime, p1 =, p2 =", conditions[i].p1)
				local ret = CheckTime( character, conditions[i].p1 )
				if ret ~= LUA_TRUE then
					PRINT( "ConditionsTest:CheckTime = false" )
					return LUA_FALSE
				end

way of use.


MisBeginCondition(CheckTime)

 

function CheckTime ( Player ) 

 

where to put?

Share this post


Link to post
Share on other sites
3 hours ago, gunnapong said:

function CheckTime ( Player ) 

 

where to put?

functions.lua


Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites

make sure the code doesn't already exist in your files.


Being better than others is for those who are weak; what matters is to be true to yourself.         

 

Share this post


Link to post
Share on other sites
6 hours ago, 1g0rS1lv4 said:

make sure the code doesn't already exist in your files.

MisBeginCondition(CheckTime)

 

Checktime  --What number should we enter?

Share this post


Link to post
Share on other sites
On 10/23/2021 at 3:44 PM, gunnapong said:

Where ?

You can place it in functions.lua, for example.


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...