Jump to content
Sign in to follow this  
Jelly

Portal close when players reached

Recommended Posts

ctrl.lua (all way on TOP)

if(MAPNAME_init == nil)then
	MAPNAME_init = function()
		maxEntry = 10;
		closedEntry = false;
	end
end

 

Find & add this inside map_copy_run_MAPNAME

local count = GetMapCopyPlayerNum(map_copy)
if(closedEntry ~= true and count >= maxEntry)then
	CloseMapEntry('MAPNAME')
	closedEntry = true
	Notice('MAPNAME portal vanished!')
end

 

Find & add this inside map_copy_before_close_MAPNAME

MAPNAME_init();

 

Note: You can also use "CloseMapCopy" to close map completely at any time you want.

Edited by Sultan
  • Like 1

Share this post


Link to post
Share on other sites

@Sultan hi sultan! thanks for the help! i wonder

 

MAPNAME_init = function()

 

why is it put that way? most scripts i see it starts with function instead.

 

can u explain?

 

thx

Share this post


Link to post
Share on other sites
1 hour ago, Foxseiz said:

Check this explanation.

 

Hidden Content

i kinda understand what hes saying but i dont know why the reason to do it

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