Jump to content

Paintball script - only for sniper


MatXpl

Recommended Posts

I edit a script paintball and i wont usa a paint balls only to sniper!

delay = 5000
r = math.random (0,255)
g = math.random (0,255)
b = math.random (0,255)
 
sniper = { [34]=true }
 
function onSpawn (team)
if ( sniper[getElementModel ( player )] )
if (team) then
removeCommandHandler ("color")
    command = false
	r, g, b = getTeamColor ( team )
elseif command == false then
    	command = addCommandHandler ( "color", setColor)
 
end
end
 
function setColor (cmd, r2, g2, b2)
if r2 then
if tonumber (r2) >= 0 and tonumber (r2) <= 255 then
    	r = tonumber (r2)
end
end
if g2 then
if tonumber (g2) >= 0 and tonumber (g2) <= 255 then
    	g = tonumber (g2)
end
end
if b2 then
if tonumber (b2) >= 0 and tonumber (b2) <= 255 then
    	b = tonumber (b2)
end
end
end
 
function weaponfired (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement )
local marker = createMarker ( hitX, hitY, hitZ, "corona", 0.1, r, g, b, 255 )
setTimer ( destroyElement, delay, 1, marker )
end
 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), onSpawn )
command = addCommandHandler ( "color", setColor)
addEventHandler ( "onClientPlayerWeaponFire", getRootElement(), weaponfired )

and this dosn't work :cry:

Help!

Sory of my bed english i'm from Poland :|

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...