Jump to content
Sign in to follow this  
xEvo7

Question about mini stun

Recommended Posts

Is there any other good way to configure mini stun effect on a set? Like having 1.2k is permanent mellee stun already even if you put the stun by 0.1% chance. It stills make it permanent. Or maybe i did it wrong? 

  • Like 1

Hit Like If You Like It!

Tekken-7.jpg

Share this post


Link to post
Share on other sites

try the value = 0.001. That will be 0.1%, not 0.1 (10%)

Not tested, but if you want to lower it further, maybe you can do:

math.mod ( 0.001 * 0.1 ) This would result as 0.0001, or ( 0.01%)

:)

 

But 0.1% should be enough. That's 1 stun every 1000 hits.

Edited by Jones
  • Like 2

Share this post


Link to post
Share on other sites
53 minutes ago, Jones said:

try the value = 0.001. That will be 0.1%, not 0.1 (10%)

Not tested, but if you want to lower it further, maybe you can do:

math.mod ( 0.001 * 0.1 ) This would result as 0.0001, or ( 0.01%)

:)

 

But 0.1% should be enough. That's 1 stun every 1000 hits.

Okay Jones i will try in few hours :D

  • Like 1

Hit Like If You Like It!

Tekken-7.jpg

Share this post


Link to post
Share on other sites

Record time stunned in state_xy , then whenever you would add the state to someone, check the last time stunned and if it is too close to the current value, dont add the stun.

Share this post


Link to post
Share on other sites
8 hours ago, Jones said:

how would u write a function for that? @7n6

 

@Treuno86 okay :D tell me how it goes!

 

Something like this:

StunTime = {}
StunTimeDiff = 5


function CheckStun( role , level)
	local NowTime = os.clock ()
	local PID = GetRoleID(role)
	if StunTime[PID] ~= nil then
		if (NowTime - StunTime[PID]) < StunTimeDiff then
			RemoveState ( role ,  STATE_XY )
			return false
		end
	end
	StunTime[GetRoleID(role)] = NowTime
end

Hook:AddPreHook("State_Xy_Add",CheckStun)

 

In this example there must be a 5 second gap between stuns, change StunTimeDiff to whatever amount of seconds.

Edited by 7n6
  • Like 1

Share this post


Link to post
Share on other sites

@7n6 interesting script :o Id would try to test it sometime.

Question about the hook,
 

Quote

Hook:AddPreHook("State_Xy_Add",CheckStun)



What does it do?

Share this post


Link to post
Share on other sites

@Jones

 

I guess something such as:

	State_Xy_Add_Original = State_Xy_Add
	State_Xy_Add = CheckStunHook
	
	
	function CheckStunHook(role, statelv)
		CheckStun(role, statelv)
		State_Xy_Add_Original(role, statelv)
	end

When server calls State_Xy_Add(), function CheckStun() will be called before

  • Like 1

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