Welcome, Guest. Please login or register.
Did you miss your activation email?
September 19, 2024, 11:56:07 PM
Home Help Login Register
News: Trouble in Terrorist Town? Site here, forum here.

Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Lua Problems?
Pages: [1]
Author Topic: Lua Problems?  (Read 4258 times)
nrich588
Poster

Posts: 253

WzG Owner


« on: May 21, 2011, 06:26:02 PM »

SWEP.Base				= "weapon_tttbase"

if SERVER then AddCSLuaFile( "shared.lua" ) end

if CLIENT then
SWEP.PrintName = "Sig Sauer 552"
SWEP.Slot = 2
SWEP.Icon = "VGUI/ttt/icon_sg552"
end

SWEP.AutoSpawnable = true

SWEP.Primary.Ammo = "Pistol"
SWEP.AmmoEnt = "item_ammo_pistol_ttt"

SWEP.Damage = {}
SWEP.Damage['head'] = {131 , 091}
SWEP.Damage['chest & arm'] = {032 , 022}
SWEP.Damage['stomach'] = {041 , 028}
SWEP.Damage['leg'] = {024 , 024}

SWEP.Primary.Delay = ( 60 / ( 634 - 60 ) )
SWEP.Primary.Recoil = ( 032 )  / 20
SWEP.Primary.Automatic = true
SWEP.Primary.Damage = 024
SWEP.Primary.Cone = ( ( 032 ) / 15 ) / 180
SWEP.Primary.ClipSize = 30
SWEP.Primary.ClipMax = 30 * 3
SWEP.Primary.DefaultClip = 30
SWEP.Primary.Zoom = 35
SWEP.Primary.ZoomTime = 35 / 75
SWEP.Scoped = false
SWEP.Scoped = true
SWEP.ViewModelFlip = true
SWEP.ViewModel = "models/weapons/v_rif_sg552.mdl"
SWEP.WorldModel = "models/weapons/w_rif_sg552.mdl"

SWEP.Primary.Sound = Sound( "Weapon_SG552.Single" )

SWEP.IronSightsPos = Vector( 0 , 0 , 0 )
SWEP.IronSightsAng = Vector( 0 , 0 , 0 )
SWEP.IronSightsLow = Vector( 0 , 0 , 0 )




My code doesnt seem to work :[
sniperduck
Poster

Posts: 178


|:NxS:| Staff! :D


« Reply #1 on: May 21, 2011, 06:43:47 PM »

SWEP.Scoped = false
SWEP.Scoped = true

problem 1
=================================

SWEP.IronSightsPos = Vector( 0 , 0 , 0 )
SWEP.IronSightsAng = Vector( 0 , 0 , 0 )
SWEP.IronSightsLow = Vector( 0 , 0 , 0 )

useless
=====================================

SWEP.Primary.Damage = 024

just use 24
===================================

SWEP.Primary.Cone = ( ( 032 ) / 15 ) / 180

SWEP.Primary.Delay = ( 60 / ( 634 - 60 ) )
SWEP.Primary.Recoil = ( 032 )  / 20

use decimals not fractions
==================================

SWEP.Primary.ClipMax = 30 * 3

dont use equations use solid numbers
=================================

SWEP.Damage = {}
SWEP.Damage['head'] = {131 , 091}
SWEP.Damage['chest & arm'] = {032 , 022}
SWEP.Damage['stomach'] = {041 , 028}
SWEP.Damage['leg'] = {024 , 024}

TTT does this automaticly, stay with SWEP.Primary.Damage, if u want more damage ona headhsot use the headshot multiplyer line.
=================================

those were examples from your script, change all like it.
=========================
===========================
=================================
=======================================


if SERVER then

  AddCSLuaFile( "shared.lua" )
end

SWEP.HoldType = "ar2"


if CLIENT then

  SWEP.PrintName = "AUG"
  SWEP.Author = "SniperDuck"
  SWEP.Slot = 2
  SWEP.SlotPos = 0

  SWEP.Icon = "VGUI/ttt/icon_m249"

  SWEP.ViewModelFlip = true
end


SWEP.Base = "weapon_tttbase"

SWEP.Spawnable = true
SWEP.AdminSpawnable = true

SWEP.Kind = WEAPON_HEAVY


SWEP.Primary.Damage = 19
SWEP.Primary.Delay = 0.06
SWEP.Primary.Cone = 0.03
SWEP.Primary.ClipSize = 30
SWEP.Primary.ClipMax = 60
SWEP.Primary.DefaultClip = 30
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = "smg1"
SWEP.AutoSpawnable      = true
SWEP.Primary.Recoil = 1.5
SWEP.Primary.Sound = Sound("Weapon_AUG.Single")
SWEP.ViewModel = "models/weapons/v_rif_aug.mdl"
SWEP.WorldModel = "models/weapons/w_rif_aug.mdl"

SWEP.AmmoEnt = "item_ammo_smg1_ttt"

SWEP.HeadshotMultiplier = 2.2

SWEP.IronSightsPos = Vector(5.99,-3,.985)
SWEP.IronSightsAng = Vector(2.4,1.9,45)



an example of a working code.


« Last Edit: May 21, 2011, 06:46:32 PM by sniperduck »

Overtime these forums have made me an asshole. ;D (TTT subforum)
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27016
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: <COMING SOON>
nrich588
Poster

Posts: 253

WzG Owner


« Reply #2 on: May 21, 2011, 06:58:31 PM »

I use ur aug in my server XD
nrich588
Poster

Posts: 253

WzG Owner


« Reply #3 on: May 21, 2011, 10:58:16 PM »

Hmm. Now it appears that you can have both an SG552 with another weapon in the same slot (they both appear as 3 in game)
sniperduck
Poster

Posts: 178


|:NxS:| Staff! :D


« Reply #4 on: May 22, 2011, 12:46:15 AM »

realy? you DLed the pack from Gmod or just copied the coding?

And IDK about that sorry :\
*****EDIT! try adding in the slotpos line.*

btw whats your servers IP?

« Last Edit: May 22, 2011, 08:15:00 PM by sniperduck »

Overtime these forums have made me an asshole. ;D (TTT subforum)
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27016
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: <COMING SOON>
nrich588
Poster

Posts: 253

WzG Owner


« Reply #5 on: May 22, 2011, 10:40:06 PM »

I pmed u the IP
sniperduck
Poster

Posts: 178


|:NxS:| Staff! :D


« Reply #6 on: May 22, 2011, 11:39:34 PM »

Odd, I didnt get it.

Overtime these forums have made me an asshole. ;D (TTT subforum)
|:NxS:| Custom TTT Server: source.nxs-gaming.com:27016
|:NxS:| Vanilla TTT Server: source.nxs-gaming.com:27016
|:NxS:| Fretta: <COMING SOON>
nrich588
Poster

Posts: 253

WzG Owner


« Reply #7 on: May 23, 2011, 08:55:46 PM »

75.102.38.27:27016
Pages: [1]
Zombie Master  |  Other  |  Trouble in Terrorist Town  |  Topic: Lua Problems? « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
Page created in 0.007 seconds with 18 queries.