Jump to content

[Solved] How to turn off/on brain of entity


Recommended Posts

I remember there being a small line of code to do that but can't remember what it was & I don't know where to look for it in the code, if somebody can help me with this fast that'd be great! Last thing I need for my mod to be finished :)! (Or any other code that makes an entity basically do nothing but stand still with a way to change them back to nromal of course)

Edited by SuperDavid
Link to comment
Share on other sites

Something like this?

 

    if target and target.brain and target.sample_projectilestun ~= true then
        target.sample_projectilestun = true
        target.brain:Stop()
        if target.components.locomotor then
            target.components.locomotor:Stop()
        end
        target:DoTaskInTime(5, function()
            target.brain:Start()
            target.sample_projectilestun = nil
        end)
    end

 

Link to comment
Share on other sites

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
 Share

×
  • Create New...