scratch that! thanks Nucular and Agonic! I got everything working perfectly now. I just need to remember if I spam teh words on normal chat ill get temporary block cuz flooding chat, but group chat is totally fine ^^
now the 2nd part I need to do is to add the timer, because, oh boy... it really does flood the chat... how do I add timer?
Trying to create a specific behavior. Can someone help?
Re: Trying to create a specific behavior. Can someone help?
Code: Select all
local TargetEntity = EntityList:GetEntity( Entity:GetTargetId() );
if TargetEntity ~= nil then
local Skill = SkillList:GetSkill( Entity:GetSkillID());
if Skill ~= nil and string.find( Skill:GetName(), "_SKILL NAME HERE_" ) ~= nil then
PlayerInput:Console("" .. TargetEntity:GetName() .. " is gonna be hit by " .. Entity:GetName() .. " );
end
end
I tried to combine this with a few lines from agonic's code, like this:
Code: Select all
timer = 0
wait = 1000
local TargetEntity = EntityList:GetEntity( Entity:GetTargetId() );
if TargetEntity ~= nil then
local Skill = SkillList:GetSkill( Entity:GetSkillID());
if Skill ~= nil and string.find( Skill:GetName(), "_SKILL NAME HERE_" ) ~= nil then
if Time() > timer then
PlayerInput:Console("" .. TargetEntity:GetName() .. " is gonna be hit by " .. Entity:GetName() .. " );
end
timer = Time() + wait
end
end
the result is even worse. nothing happened

im at a loss. what part did I do wrong?
thanks again for all of the great helps!
Re: Trying to create a specific behavior. Can someone help?
thats just a sample. the skill name here is the part that u change according to skill. like in IS - powerful ide, in IO - Salvo, etc etc...
in any case, theres nothing broken with that part. the only problem now is I dont know how to make a timer thats all...
- nucular
- Site Admin
- Posts: 260
- Joined: Sat Jan 07, 2017 9:08 pm
- Has thanked: 27 times
- Been thanked: 388 times
Re: Trying to create a specific behavior. Can someone help?
Code: Select all
local TargetEntity = EntityList:GetEntity( Entity:GetTargetId() );
if TargetEntity ~= nil then
local Skill = SkillList:GetSkill( Entity:GetSkillID());
if Skill ~= nil and string.find( Skill:GetName(), "_SKILL NAME HERE_" ) ~= nil then
if ShoutTimer == nil or ShoutTimer < Time() then
PlayerInput:Console("" .. TargetEntity:GetName() .. " is gonna be hit by " .. Entity:GetName() .. " );
ShoutTimer = Time() + 3000; -- shout limit to 3 seconds
end
end
end

Re: Trying to create a specific behavior. Can someone help?
this works perfectly as intended now, nucular. thank you very much for this, you have been a super great help!nucular wrote: ↑Fri Jul 28, 2017 6:52 pmShould work, i'm kinda sad that no one knows how to do that ....Code: Select all
local TargetEntity = EntityList:GetEntity( Entity:GetTargetId() ); if TargetEntity ~= nil then local Skill = SkillList:GetSkill( Entity:GetSkillID()); if Skill ~= nil and string.find( Skill:GetName(), "_SKILL NAME HERE_" ) ~= nil then if ShoutTimer == nil or ShoutTimer < Time() then PlayerInput:Console("" .. TargetEntity:GetName() .. " is gonna be hit by " .. Entity:GetName() .. " ); ShoutTimer = Time() + 3000; -- shout limit to 3 seconds end end end
![]()

this side project has been a major success!
Who is online
Users browsing this forum: No registered users and 1 guest