View Single Post
  #7  
Unread 06-10-2012, 12:30 PM
moebius92 moebius92 is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 51
for loops. for loops are your friend.

You'll want something like...

for i = 1, EffectList:GetCount(), 1 do
if EffectList:Get(i):GetName() == "Charge" then
dostuff();
break;
end
end

Actually, what you might want to start with is:

for i = 1, EffectList:GetCount(), 1 do
Turbine.Shell.WriteLine(EffectList:Get(i):GetName( ));
end

...so you can check the names of all of the effects. It probably is called "Charge", but you never know.

And remember that string comparisons with == are case sensitive, so you'll want to get the case right.

Edit: Lua Reference manual is also your friend. Feel free to keep asking questions, but there's a good chance I'll be looking up the answer in the reference manual.

Last edited by moebius92 : 06-10-2012 at 12:48 PM.
Reply With Quote