Scripting: spawn a working weapon

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
At0miC
General
Posts: 1164
Joined: Fri Feb 27, 2004 11:29 pm
Location: The Netherlands

Scripting: spawn a working weapon

Post by At0miC »

Hey, I need some help with spawning a weapon in a stock map that players can use. I tried to start on this script, but i dunno if it is good, and I need to know how to make it so the player can pickup this weapon.


spawn script_object "targetname" "colt45" "origin" "( 3886 3872 -448 )" // have no location yet
$colt45.model = "weapons/colt45.tik"
$colt45 show
$colt45.angles = ( 0 300 0 ) // not known yet
$colt45.scale = 1.0


thnx At0miC
Last edited by At0miC on Sat Dec 25, 2004 12:17 pm, edited 1 time in total.
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

This is all I have used and it works fine.

Code: Select all

local.colt45 = spawn models/weapons/colt45.tik origin ( -6340 -1555 714.20 ) angles ( 0 0 90 )
Dont define it as a script model and it should be fine.
User avatar
At0miC
General
Posts: 1164
Joined: Fri Feb 27, 2004 11:29 pm
Location: The Netherlands

Post by At0miC »

hey thnx man :D
User avatar
At0miC
General
Posts: 1164
Joined: Fri Feb 27, 2004 11:29 pm
Location: The Netherlands

Post by At0miC »

And does someone know how to make it that if a player picked up that model, that he can't still picking up the ammo for it?

Because if u pickup the gun (so you don't see it anymore), you can still press use to get ammo of it on that location.
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

try spawning as static model?
Image
Post Reply