Results 1 to 2 of 2

Thread: trigger question

  1. #1

    Default trigger question

    is there a way to text the player at a trigger before they use? like hover on the trigger?

  2. #2

    Default

    That seems like a hybrid trigger_multiple and trigger_use. You could add both triggers at one origin, disabling the "multiple" whenever "use" is triggered. But an easier way is to check for "local.player.useheld" in a trigger_multiple's setthread. Try this example below:

    Code:
    test:
    
    	local.trig = spawn trigger_multiple
    	local.trig.model = "models/weapons/kar98sniper.tik"
    	local.trig.origin = ( 0 0 100 )
    	local.trig.angles = ( 180 0 90 )
    	local.trig setsize ( -30 -30 -5 ) ( 30 30 30 )
    	local.trig.scale = 1
    	local.trig light 1 0 0 65
    	local.trig show
    	local.trig setthread pickup
    end
    
    pickup:
    
    	self nottriggerable
    	local.player = parm.other
    
    	if(local.player.useheld == 1)
    	{
    		//local.player iprint ("Picked up a sniper.")
    		self message ("*** Picked up a sniper. ***")
    		local.player give "models/weapons/kar98sniper.tik"
    		local.player stufftext "useweaponclass rifle"
    		local.player playsound kar98_snd_pickup_ammo
    		self hide
    
    		wait 3
    		self triggerable
    		self message ("")
    		self show
    		end
    	}
    
    	wait 1
    	local.player iprint ("Hold USE to pick up a sniper.")
    	//self message ("*** Hold USE to pick up a sniper. ***")
    	self triggerable
    end
    Last edited by Searingwolfe; January 23rd, 2023 at 03:12 PM. Reason: Fixed code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •