robox44
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 737 |
|
|
| 11 Jun 2013 11:57 PM |
First problem, is that I don't know how to get my part "flash" to turn to transparency 0 when fired and how to also make the pointlight inside of the flash to become enabled.
equiped=false sp=script.Parent RayLength=100000 Spread=.1 enabled=true reloading=false down=false r=game:service("RunService") last=0 last2=0 last3=0 last4=0 last5=0 last6=0
p = Instance.new("Part") p.Parent = game.Lighting p.Name = "BulletTexture" p.CanCollide = false p.formFactor = "Custom" p.Size = Vector3.new(1,0.1,1) p.Transparency = 1 g = Instance.new("SpecialMesh") g.Parent = p
Bullet=Instance.new("Part") Bullet.Name="Bullet" Bullet.BrickColor=BrickColor.new("New Yeller") Bullet.Anchored=true Bullet.CanCollide=false Bullet.Locked=true Bullet.Size=Vector3.new(1,1,1) --Bullet.Transparency=.65 Bullet.formFactor=0 Bullet.TopSurface=0 Bullet.BottomSurface=0 mesh=Instance.new("SpecialMesh") mesh.Parent=Bullet mesh.MeshType="Brick" mesh.Name="Mesh" mesh.Scale=Vector3.new(.15,.15,1)
function check() sp.Name=ToolName.."-("..tostring(sp.Ammo.Value)..")" end
function computeDirection(vec) local lenSquared = vec.magnitude * vec.magnitude local invSqrt = 1 / math.sqrt(lenSquared) return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
It should be inserted in here.
Also, for some reason, later in the script, I'm unable to put -or ("model.className=Terrain")
the gun stops functioning all in all. I even tried just typing in Terrain where SpawnLocation was and it still makes the gun not operate.
--Returns hit, position, normal, time function raycast(model, start, vector, brickFunction) local hit, normal, time = raycastRecursive(model, start, vector, brickFunction, vector.unit, dot(start, vector.unit)) if (dot(normal, vector) > 0) then normal = -normal end return hit, start + time * vector, normal.unit, time end function raycastRecursive(model, start, vector, brickFunction, unitVec, startDist) if (model.className == "Part") or (model.className == "Seat") or (model.className =="SpawnLocation") then local range = model.Size.magnitude / 2 local dist = dot(model.Position, unitVec) - startDist if (dist + range > 0) and (dist - range < vector.magnitude) and ((dist * unitVec + start - model.Position).magnitude < range) and brickFunction(model) then local halfSize = model.Size / 2 if (model.Shape == Enum.PartType.Ball) then local time, timeMax = getLineSphereCollide(start, vector, model.Position, halfSize.x) if (time < 1) and (time >= 0) then return model, (time * vector + start - model.Position), time
thanks -robox44 |
|
|
| Report Abuse |
|
robox44
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 737 |
|
| |
robox44
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 737 |
|
|
| 12 Jun 2013 05:26 PM |
| Bump, this is getting super annoying |
|
|
| Report Abuse |
|
|
| 12 Jun 2013 05:37 PM |
@Question number 1
Part.Transparency = 0 PointLight.Enabled = false
Pretty basic stuff... |
|
|
| Report Abuse |
|
robox44
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 737 |
|
|
| 12 Jun 2013 06:18 PM |
^^^ Tried that, didn't work.
But anyways, I figured it out myself and fixed it! |
|
|
| Report Abuse |
|