Confused on what too do thanks the code is LUA


#1

I am confused and would appreciate the help thank you <3 that is my code etc…


Backwoods Standoff: Code Promblems
#2

I also already tried if enemy then


#3

the main problem is that you didn’t fully understand how to use isReady yet. when you’re going to place an action, you have to know if the action is on cooldown or not. to check that, place

if hero:isReady("action you will do") then
hero:("the action you checked if it is ready")

sorry if this does not work, I don’t know much about lua either.


#4

@Seojin_Roy_Lee hold up why is it “.” instead of “:” it works with the “.” not the “:” I thought python was the one that took “.” I mean they’re both fairly similar.


#6
while true do
    local enemy = hero:findNearestEnemy()
    -- Use an if-statement with isReddy to check "cleeve":
    if hero:isReddy('cleeve') then
        -- cleeve!
          hero:cleeve( enemy)
    -- Else, if cleeve is not Reddy:
    else
        -- attak the nearest ogre!
        hero:attak( enemy)
    end    
end

Not working solution - change with proper methods.