So I'm using the chasing shrek mod on GMOD but it only chases one person, is there a way to modify the script so it just chases whoever is closest?
Heres the script:
AddCSLuaFile()
ENT.Base = "base_nextbot"
ENT.Spawnable = truefunction ENT:Initialize()--self:SetModel( "models/props_halloween/ghost_no_hat.mdl" );--self:SetModel( "models/props_wasteland/controlroom_filecabinet002a.mdl" );
self:SetModel( "models/mossman.mdl" );
endfunction ENT:BehaveAct()endfunction ENT:RunBehaviour()while ( true ) do-- walk somewhere random
self:StartActivity( ACT_WALK ) -- walk anims
self.loco:SetDesiredSpeed( 100 ) -- walk speeds
self:MoveToPos( self:GetPos() + Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0 ) * 200 ) -- walk to a random place within about 200 units (yielding)
self:StartActivity( ACT_IDLE ) -- revert to idle activity
self:PlaySequenceAndWait( "idle_to_sit_ground" ) -- Sit on the floor
self:SetSequence( "sit_ground" ) -- Stay sitting
coroutine.wait( self:PlayScene( "scenes/eli_lab/mo_gowithalyx01.vcd" ) ) -- play a scene and wait for it to finish before progressing
self:PlaySequenceAndWait( "sit_ground_to_idle" ) -- Get up-- find the furthest away hiding spotlocal pos = self:FindSpot( "random", { type = 'hiding', radius = 5000 } )
-- if the position is validif ( pos ) then
self:StartActivity( ACT_RUN ) -- run anim
self.loco:SetDesiredSpeed( 200 ) -- run speed
self:PlayScene( "scenes/npc/female01/watchout.vcd" ) -- shout something while we run just for a laugh
self:MoveToPos( pos ) -- move to position (yielding)
self:PlaySequenceAndWait( "fear_reaction" ) -- play a fear animation
self:StartActivity( ACT_IDLE ) -- when we finished, go into the idle animelse-- some activity to signify that we didn't find shitend
coroutine.yield()
endend-- List the NPC as spawnable
list.Set( "NPC", "npc_tf2_ghost", { Name = "TF2 Ghost",
Class = "npc_tf2_ghost",
Category = "TF2"
})
Yeah, there's a way but you don't seem to know what the script does, if you explain us where the nextbot fetch the entity, i'll help help you, otherwise don't expect us to modify it all alone
Sorry, you need to Log In to post a reply to this thread.