Page 1 of 1

Re: How to use the OnEnterRegion function

Posted: Sun Jan 06, 2008 12:11 pm
by Maveritchell

Code: Select all

ActivateRegion("regionname")
testfunction = OnEnterRegion(
	function(region, player)
		if [whatever callbacks you want] then
			whatvever you want to happen
		end
	end,
"regionname"
)

Re: How to use the OnEnterRegion function

Posted: Mon Jan 07, 2008 12:22 pm
by Eagle Eye
thanks!

Re: How to use the OnEnterRegion function (FAQ)

Posted: Thu Feb 13, 2020 2:53 pm
by correctmushroom2013
Updated!
More correctly and working of code version))

Code: Select all

ActivateRegion("NameReg")
NameReg = OnEnterRegion( 
    function(region, player) 
      if IsCharacterHuman(player) then 
        PlayAnimation("AnimName") 
		DeactivateRegion("NameReg")	
      end 
   end, 
 "NameReg" 
)
NameReg - name of your region
AnimName - name of your animation group
:wink: