skyarex
|
  |
| Joined: 21 Mar 2010 |
| Total Posts: 12989 |
|
|
| 13 Dec 2013 01:02 PM |
CurAmmo = script.Parent.CurAmmo.Value MagAmount = script.Parent.MagAmount.Value Hit1 = math.random(50,115) Hit2 = math.random(50,90) Hit3 = math.random(50,65) RawDmg = (Hit1 + Hit2 + Hit3)/3 HitDmg = math.celi(Dmg) TotalAmmo = CurAmmo * MagAmount
bulletFired = false EnoughAMMO = true
function Fire() if EnoughAMMO == true then bullet = Instance.new("Part",game:GetService("Lighting")) bullet.Shape = "Ball" bullet.Name = "Bullet" bullet.Size = Vector3.new(.5,.5,.5) bullet.Position = script.Parent.Muzzle.Position bullet.BodyForce.force = Vector3.new(100,0,0) bullet.Touched:connect(function(hit) bulletFired = true if hit.Parent:findFirstChild("ForceField") ~= nil then bulletFired = false return elseif hit.Parent:FindFirstChild("Humanoid") then hit.Parent.findFirstChild("Humanoid").TakeDamage(Dmg) bulletFired = false else bullet:Destroy() end end
script.Parent.Button1Down:connect(Fire)
script.Parent.Button2Down:connect(Scope)
script.Parent.KeyDown:connect(key)
"Don't Panic"- HHGTTG |
|
|
| Report Abuse |
|
|
skyarex
|
  |
| Joined: 21 Mar 2010 |
| Total Posts: 12989 |
|
| |
|
Shonysky
|
  |
| Joined: 05 Aug 2013 |
| Total Posts: 361 |
|
|
| 13 Dec 2013 01:55 PM |
hit.Parent.findFirstChild("Humanoid"):TakeDamage(Dmg)
|
|
|
| Report Abuse |
|
|
skyarex
|
  |
| Joined: 21 Mar 2010 |
| Total Posts: 12989 |
|
| |
|
skyarex
|
  |
| Joined: 21 Mar 2010 |
| Total Posts: 12989 |
|
|
| 13 Dec 2013 03:49 PM |
It still isn't workn for some reason
"Don't Panic"- HHGTTG |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2013 03:52 PM |
| ogm just watch the output e.e |
|
|
| Report Abuse |
|
|
skyarex
|
  |
| Joined: 21 Mar 2010 |
| Total Posts: 12989 |
|
|
| 13 Dec 2013 04:03 PM |
@gi
I saw the output. I am posting here because i don't know why it isn't working ._.
"Don't Panic"- HHGTTG |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 13 Dec 2013 04:07 PM |
| You cannot parent Parts and Models to lighting anymore? |
|
|
| Report Abuse |
|
|
VilleSlay
|
  |
| Joined: 14 May 2011 |
| Total Posts: 1405 |
|
|
| 13 Dec 2013 04:30 PM |
bullet = Instance.new("Part",game:GetService("Lighting"))
This won't be visible for the player. You are aware of that, right? |
|
|
| Report Abuse |
|
|
VilleSlay
|
  |
| Joined: 14 May 2011 |
| Total Posts: 1405 |
|
|
| 13 Dec 2013 04:34 PM |
HitDmg = math.celi(Dmg)
math.ceil is the correct way to do it.
Also, you need to make Dmg a number. As of right now, it is just an argument. |
|
|
| Report Abuse |
|
|
getkoed
|
  |
| Joined: 18 Feb 2010 |
| Total Posts: 2298 |
|
|
| 13 Dec 2013 05:35 PM |
:findFirstChild
--------NOT-------- --------NOT-------- --------NOT--------
.findFirstChild |
|
|
| Report Abuse |
|
|