Jump to content

Recommended Posts

Does anyone know how to make this work on the touchscreen?

local function getstatus(inst)        
        if TheInput:IsKeyDown(KEY_ALT) then
            local home = FindEntity(inst, 10, function(ent)
                return ent.components.prototyper
                    and ent:HasTag('critterlab')
                end)
        if home then
            local x,y,z = home.Transform:GetWorldPosition()
            inst:SetBrain(nil)
            inst.sg:GoToState('idle')
            inst.components.locomotor:GoToPoint(Point(x+0.5, y, z+0.5),nil,true)
            --GetPlayer().components.leader:RemoveFollower(inst)
            inst:DoTaskInTime(1.5,function() 
            inst:Remove() end)
        end
    end
end

 

Link to comment
https://forums.kleientertainment.com/forums/topic/120875-iskeydown/
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
×
  • Create New...