Results 1 to 4 of 4

Thread: how to make Light with 360 model usable

  1. #1

    Default how to make Light with 360 model usable

    So, i have been adding weapons on maps with lights and the 360 rotatey but noticed you can't automatedly pick the weapon up anymore


    Can pick up weapon


    local.kar98 = spawn "models/weapons/kar98.tik"
    local.kar98.origin = ( 1500 700 405 )
    local.kar98.angles = ( 180 0 90 )
    local.kar98.scale = 1
    local.kar98 light 1 0 0 65
    local.kar98 rotatey 360 //| DOESNT WORK NO LONGER A SCRIPT MODEL , BUT WEAPON CAN BE PICKED UP AND LIGHT WORKS





    Can't pick up weapon

    local.kar98 = spawn script_model
    local.kar98 = model "models/weapons/kar98.tik"
    local.kar98.origin = ( 1500 700 405 )
    local.kar98.angles = ( 180 0 90 )
    local.kar98.scale = 1
    local.kar98 light 1 0 0 65
    local.kar98 rotatey 360 //| WORKS NOW A SCRIPT MODEL BUT WEAPON CAN NOT BE PICKED UP AND LIGHT WORKS

    Last edited by assasin5469; November 7th, 2022 at 12:26 AM.

  2. #2

    Default

    There's a few ways you could do this. First, get rid of the equals sign in (local.kar98 = model "models/weapons/kar98.tik") to get (local.kar98 model "models/weapons/kar98.tik"), or do (local.kar98.model = "models/weapons/kar98.tik"). For a script_model, ideally make it notsolid. I tried the code where you can pick up the kar98, but only after you drop your main weapon. If you want, you can make it trigger_use instead of a script_model, then make the trigger give players a kar98, without dropping their old gun.
    For the rotation, you'll have to continuously change the non-script_model's angles inside of a while(1) loop. Code examples are below:

    Code:
    test: // tested on mohdm1, so change origins.
    
    local.kar98 = spawn "models/weapons/kar98.tik"
    local.kar98.origin = ( 680 -320 10 )
    local.kar98.angles = ( 180 0 90 )
    local.kar98.scale = 1
    local.kar98 light 1 0 0 65
    local.kar98 notsolid
    local.kar98 thread rotate
    
    local.kar988 = spawn trigger_use
    local.kar988 model "models/weapons/kar98.tik" // or local.kar988.model = ""
    local.kar988.origin = ( 790 -320 10 )
    local.kar988.angles = ( 180 0 90 )
    local.kar988 setsize ( -30 -30 -20 ) ( 30 30 50 )
    local.kar988.scale = 1
    local.kar988 light 1 0 0 65
    local.kar988 show
    local.kar988 setthread givekar98
    local.kar988 thread rotate
    end
    
    givekar98:
    
    	self nottriggerable
    	self hide
    
    	local.player = parm.other
    	local.player iprint ("You got a kar98.")
    	local.player give "models/weapons/kar98.tik"
    
    	wait 3
    	
    	self show
    	self triggerable
    end
    
    rotate:
    
    	while(1)
    	{
    		self.angles = (self.angles + ( 0 10 0 ))
    		waitframe
    	}
    end
    Last edited by Searingwolfe; November 7th, 2022 at 08:46 AM.

  3. #3

    Default

    this is perfect thanks for the quick reply!!!

    get rid of the equals sign in (local.kar98 = model "models/weapons/kar98.tik")
    :P was a type error didn't mean to put it there lol.


    Also, I assume I would need to have a new RAISE state in the mike for the swap on the wep?

  4. #4

    Default

    Not sure if you can see this post. My last two were waiting for a mod to approve, but they're still pending a month later. Try this code: when triggered, the player gets a kar98 with ammo pickup sound, and auto-switches to the rifle class.

    Code:
    kar98trigger:
    
    local.kar98 = spawn "models/weapons/kar98.tik"
    local.kar98.origin = ( 680 -320 10 )
    local.kar98.angles = ( 180 0 90 )
    local.kar98.scale = 1
    local.kar98 light 1 0 0 65
    local.kar98 notsolid
    local.kar98 thread rotate
    
    local.kar988 = spawn trigger_use
    local.kar988.model = "models/weapons/kar98.tik"
    local.kar988.origin = ( 790 -320 10 )
    local.kar988.angles = ( 180 0 90 )
    local.kar988 setsize ( -30 -30 -20 ) ( 30 30 50 )
    local.kar988.scale = 1
    local.kar988 light 1 0 0 65
    local.kar988 show
    local.kar988 setthread givekar98
    local.kar988 thread rotate
    end
    
    givekar98:
    
    	self nottriggerable
    	self hide
    
    	local.player = parm.other
    	local.player iprint ("You got a kar98.")
    	local.player give "models/weapons/kar98.tik"
    	local.player stufftext "useweaponclass rifle"
    	local.player playsound kar98_snd_pickup_ammo
    
    	wait 3
    	
    	self show
    	self triggerable
    	
    end
    
    rotate:
    
    	while(1)
    	{
    		self.angles = (self.angles + ( 0 10 0 ))
    		waitframe
    	}
    end

Posting Permissions

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