FootBa11
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 11501 |
|
|
| 04 Feb 2012 06:14 PM |
:3
originalAmmo = script.Parent.Ammo.Value m = Instance.new("Message")
function computeDirection(vec) local lenSquared = vec.magnitude^2 local invSqrt = 1 / math.sqrt(lenSquared) return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt) end
function updateAmmo() m.Text = " " --for i = 1,script.Parent.Ammo.Value do -- m.Text = m.Text .. "|" --end --for i = 1, (originalAmmo - script.Parent.Ammo.Value) do -- m.Text = m.Text .. " " --end m.Text = m.Text .. " " .. script.Parent.Ammo.Value.. "/10" end
function fire(v) for i = 1,1 do script.Parent.Handle.Fire:play() script.Parent.Ammo.Value = script.Parent.Ammo.Value - 1 updateAmmo()
local dir = v - script.Parent["Handle"].Position dir = computeDirection(dir)
local pos = script.Parent["Handle"].Position + (dir * 6)
local p = Instance.new("Part") p.Name = "Projectile" p.CFrame = CFrame.new(pos, pos + dir) p.BrickColor = BrickColor.new(21) p.Reflectance = 0.1 p.Velocity = (script.Parent.Parent["Head"].Position - v).unit * -150 p.Size = Vector3.new(1, 0.4, 1) p.formFactor = 2
local mesh = script.Parent.Mesh:clone() mesh.Parent = p
local upforce = Instance.new("BodyForce") upforce.force = Vector3.new(0, p:GetMass() * 196, 0) upforce.Parent = p
local creator = Instance.new("ObjectValue") creator.Name = "creator" creator.Value = game.Players:GetPlayerFromCharacter(script.Parent.Parent) creator.Parent = p
local s = script.Parent["ProjectileScript"]:Clone() s.Disabled = false s.Parent = p p.Parent = game.Workspace wait(0) end end
function onActivated() if script.Parent.Enabled == true then script.Parent.Enabled = false if script.Parent.Ammo.Value > 0 then fire(script.Parent.Parent["Humanoid"].TargetPoint) else script.Parent.Enabled = false script.Parent.Handle.Reload:play() m.Text = "Reloading." for i =1,5 do wait(0.3) m.Text = m.Text .. "." end script.Parent.Ammo.Value = originalAmmo updateAmmo() script.Parent.Enabled = true end wait(0.1) script.Parent.Enabled = true end end
function onEquipped() local p = game.Players:GetChildren() for i = 1,#p do if p[i].Character == script.Parent.Parent then m.Parent = p[i] end end updateAmmo() end
function onUnequipped() m.Parent = nil end
script.Parent.Activated:connect(onActivated) script.Parent.Equipped:connect(onEquipped) script.Parent.Unequipped:connect(onUnequipped) |
|
|
| Report Abuse |
|
|
| |
|
FootBa11
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 11501 |
|
|
| 04 Feb 2012 06:19 PM |
Your argument is invalid a request is for someone to make a whole script for me I need to you to edit this one go troll someone else |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 04 Feb 2012 06:35 PM |
That is a request,
argument valid.
go try to be smart somewhere else. |
|
|
| Report Abuse |
|
|
|
| 04 Feb 2012 06:36 PM |
"I need you to edit this one"
"need" can be replaced with "request" therefore, it is an request. |
|
|
| Report Abuse |
|
|
FootBa11
|
  |
| Joined: 16 Sep 2008 |
| Total Posts: 11501 |
|
|
| 04 Feb 2012 06:46 PM |
"it is an request"
Have you ever been to school? |
|
|
| Report Abuse |
|
|
mage11561
|
  |
| Joined: 03 Sep 2008 |
| Total Posts: 13217 |
|
|
| 04 Feb 2012 06:46 PM |
yes we have,
and we know that this is a request.
now learn to script and go away. |
|
|
| Report Abuse |
|
|