Public feed #377270

Mine

public lua v1 · immutable
Raw Edit
·published 2007-03-01 16:49 UTC
rendered paste body
AddCSLuaFile( "cl_init.lua" )AddCSLuaFile( "shared.lua" )include( 'shared.lua' )  function ENT:SpawnFunction( ply, tr )     if ( !tr.Hit ) then return end       local SpawnPos = tr.HitPos + tr.HitNormal * 1       local ent = ents.Create( "paintball" )        ent:SetPos( SpawnPos )    ent:Spawn()    ent:Activate()       return ent   end  /*---------------------------------------------------------   Name: Initialize---------------------------------------------------------*/function ENT:Initialize()     // Temp Paintball Model    self.Entity:SetModel( "models/props/cs_office/snowman_mouth1.mdl" )       // Sphere it.    self.Entity:PhysicsInitSphere( 1, "" )       // Wake up!	self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) 	self.Entity:SetSolid( SOLID_VPHYSICS )	self.Entity:SetColor( math.random(0,255), math.random(0,255), math.random(0,255), 255 )    	// Set collision bounds exactly    self.Entity:SetCollisionBounds( Vector( 1, 1, 1 ), Vector( 1, 1, 1 ) )   end /*---------------------------------------------------------   Name: PhysicsCollide---------------------------------------------------------*/function ENT:PhysicsCollide( data, physobj )		local worldpos1 = data.HitPos + data.HitNormal // Set worldpos 1. Add to the hitpos the world normal.	local worldpos2 = data.HitPos - data.HitNormal // Set worldpos 2. Subtract from the hitpos the world normal.  	util.Decal("Blood",worldpos1,worldpos2) 	end