Flyforfame Automaton Autoexp(Problem)

03/24/2009 14:05 igorekpl#1
Hey
I have problem i wrote a little kind of code and it doesn't work

i take this code here:
Code:
local Player = GetPlayer ()
local Actors = GetActors ()

function wtfux.attacka ()
if ( Actor:Get ( "Attackable" ) ) and ( Actor ~= Player ) then
			if (Arguments == nil) or (Arguments == "") then
      		          Attack (Actor, 0)
end        

Register ( wtfux, "wtfux" )
AddCommand ( wtfux.attacka, "autoattack", "", "Autoattack once monster" )
if you have correct code or you repair it i'm happy

thank you...
03/24/2009 14:41 Flyff_Service#2
Code:
local wtfux = { }

function wtfux.OnUnload ()
	RemoveCommand ( "autoattack" )
end

function wtfux.attacka (Arguments, Device)
local Player = GetPlayer ()
local Actors = GetActors ()

for k, Actor in pairs(Actors) do
	if ( not IsPlayer ( Actor ) ) and ( Actor:Get ( "Attackable" ) ) then
		Attack (Actor, 0)
	end
end

end

Register ( wtfux, "wtfux" )
AddCommand ( wtfux.attacka, "autoattack", "", "Autoattack once monster" )
03/24/2009 15:09 igorekpl#3
i test and i say you if it work xD

Edit:
it not work its say in console:
Code:
Error : Execution of command failed
If you can repair this script i very happy...