xEvo7 65 Report post Posted April 15, 2016 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? 1 Quote Hit Like If You Like It! Share this post Link to post Share on other sites
Jones 36 Report post Posted April 15, 2016 (edited) 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 April 15, 2016 by Jones 2 Quote Share this post Link to post Share on other sites
xEvo7 65 Report post Posted April 15, 2016 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 1 Quote Hit Like If You Like It! Share this post Link to post Share on other sites
Rinor 59 Report post Posted April 15, 2016 @Treuno86 Hi, can you check messages? Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted April 15, 2016 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. Quote Share this post Link to post Share on other sites
Jones 36 Report post Posted April 15, 2016 how would u write a function for that? @7n6 @Treuno86 okay tell me how it goes! Quote Share this post Link to post Share on other sites
Billy 164 Report post Posted April 15, 2016 (edited) 8 hours ago, Jones said: how would u write a function for that? @7n6 @Treuno86 okay 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 April 15, 2016 by 7n6 1 Quote Share this post Link to post Share on other sites
Jones 36 Report post Posted April 16, 2016 @7n6 interesting script Id would try to test it sometime. Question about the hook, Quote Hook:AddPreHook("State_Xy_Add",CheckStun) What does it do? Quote Share this post Link to post Share on other sites
V3ct0r 2,121 Report post Posted April 16, 2016 @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 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
xEvo7 65 Report post Posted April 16, 2016 thank you guys for helping i just removed stun on my server. no more problem LOL 1 Quote Hit Like If You Like It! Share this post Link to post Share on other sites