Jump to content

Change default animation from slothbot when they're chasing


Recommended Posts

Hello guys,

Can I change default animation of slothbot when they (bots) are chasing? I mean: by default, the bots walks normally. Since I'm using it on a zombie server, I would like to change it to WALK_drunk animation.

Tried to learn the slothboth's code, but didn't find anything.

Thanks a lot,

Stanley Sathler.

Link to comment

Yo guys,

Didn't know about setPedWalkingStyle() (never heard about before). I'm trying to insert it into the code, but doesn't work properly yet. When the ped (zombie) starts to follow us, on the first second, the animation works, but then changes to normal again. Seems the code is "refreshing" the animation.

Maybe I could use a setTimer(), but I'm trying to use the function just one time first. Any idea?

By the way, if I get something, I'll back to tell you guys.

Link to comment

That's the problem: where? Already tried to add it into the spawn function, including with a tmer, but nothing happens. I'm still having the problem with "refresh" walk animation.

Manawydan, did you try? Where you put the function?

I already tried to insert it in a lot of functions, and nothing. I really don't know what is happening.

Link to comment

try change the event:

addEvent( "bot_Forwards", true ) 
function Bforward () 
    if (isElement(source)) then 
        setPedControlState( source, "forwards", true ) 
    end 
end 
addEventHandler( "bot_Forwards", getRootElement(), Bforward ) 

instead setPedControlState try put setPedAnimation(source,arguments..)

and in :

addEvent( "bot_Stop", true ) 
function Bstop ( ) 
    if (isElement(source)) then 
        setPedControlState( source, "forwards", false ) 
    end 
end 
addEventHandler( "bot_Stop", getRootElement(), Bstop ) 

try this:

addEvent( "bot_Stop", true ) 
function Bstop ( ) 
    if (isElement(source)) then 
        setPedControlState( source, "forwards", false ) 
setPedAnimation(source) 
    end 
end 
addEventHandler( "bot_Stop", getRootElement(), Bstop ) 

Link to comment

We're almost there, manawydan. What occurs at the moment: when they spawn, they're with animation. If you punch them, the animation is stopped and they starts to walk normally again. Also, they don't attack us too when they're with animation.

I'll see what I can do about this. Don't want to bother you again, cannot make you read all the code for help me with one thing that I can do by myself (read code). You gave me the first step. Thank you alot. Not only you, but also Blaze, Masry and Buffalo.

Link to comment

Ok guyz, I figured this. It's realy easy!

Go to zombie_server.lua

Replace line 6 - 18 with this:

  
if ZombieSpeed == 0 then --super slow zombies (goofy looking) 
    chaseanim = "WALK_drunk" 
    checkspeed = 2000 
elseif ZombieSpeed == 1 then -- normal speed 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
elseif ZombieSpeed == 2 then -- rocket zombies (possibly stressful on server) 
    chaseanim = "WALK_drunk" 
    checkspeed = 680 
else -- defaults back to normal 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
end 
  

Link to comment
  • MTA Team
Ok guyz, I figured this. It's realy easy!

Go to zombie_server.lua

Replace line 6 - 18 with this:

  
if ZombieSpeed == 0 then --super slow zombies (goofy looking) 
    chaseanim = "WALK_drunk" 
    checkspeed = 2000 
elseif ZombieSpeed == 1 then -- normal speed 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
elseif ZombieSpeed == 2 then -- rocket zombies (possibly stressful on server) 
    chaseanim = "WALK_drunk" 
    checkspeed = 680 
else -- defaults back to normal 
    chaseanim = "WALK_drunk" 
    checkspeed = 1000 
end 
  

Did you even read the first post? SLOTHBOT, not ZOMBIES resource.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...