acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 12 Sep 2010 08:49 PM |
Can you help with this script? Here's the output: attempt to call a nil value That's all it says!! It doesn't give me a line # or anything! I think it's on lines 69, 70, 73, or 76... I wish I could give you more info, but i can't.
Tool = script.Parent colors = {24} local a = 0 function fire(v) Tool.Handle.Fire:play() local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local missile = Instance.new("Part") local spawnPos = vCharacter.PrimaryPart.Position spawnPos = spawnPos + (v * 8) missile.Position = spawnPos missile.Size = Vector3.new(0.2,0.2,0.2) missile.Velocity = v * 641 missile.BrickColor = BrickColor.new(colors[math.random(1, #colors)]) missile.Shape = 0.5 missile.BottomSurface = 0 missile.TopSurface = 0 missile.Name = "Paintball" missile.Elasticity = 0 missile.Reflectance = 0 missile.Friction = 1 local force = Instance.new("BodyForce") force.force = Vector3.new(0,75,0) force.Parent = missile Tool.BrickCleanup:clone().Parent = missile local new_script = script.Parent.Paintball:clone() new_script.Disabled = false new_script.Parent = missile local mesh = Tool.Mesh:clone() mesh.Parent = missile local creator_tag = Instance.new("ObjectValue") creator_tag.Value = vPlayer creator_tag.Name = "creator" creator_tag.Parent = missile missile.Parent = game.Workspace end function check(en) if (Tool.Enabled == false) then return false end if (Tool.Enabled == true) then return true end end Tool.Enabled = true while a == 1 do function onActivated() if not Tool.Enabled then return end local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit if (check()) then fire(lookAt) wait(0.05) onActivated() end return end end script.Parent.Activated:connect(onActivated) function Equip(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) --could be here mouse.Button1Up:connect(function() nofiar(mouse) end) --or here end Tool.Equipped:connect(Equip) function onButton1Down(mouse) --or here a = 1 end function nofair(mouse) a = 0 --or here... end |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
pighead10
|
  |
| Joined: 03 May 2009 |
| Total Posts: 10341 |
|
|
| 13 Sep 2010 09:44 AM |
| Well, there is a nil value somewhere in the script. That is, you are trying to call something which doesn't exist. |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2010 10:04 AM |
| You tried calling the function 'nofiar' before you defined it. |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 13 Sep 2010 04:47 PM |
| ... Okay... How do I fix it?! |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 13 Sep 2010 05:38 PM |
| Man, guys... I can't tell you how much I appreciate the help you're giving me! Thank you from the deepest of my heart, thank you!!!!! |
|
|
| Report Abuse |
|
|
harutsedo
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 5150 |
|
|
| 13 Sep 2010 05:39 PM |
| Move the function up the script, then. |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 13 Sep 2010 05:59 PM |
This is the output of this script...
attempt to call a nil value Disconnected event because of exception Players.Player.Backpack.Auto Pistol.PaintballShooter:76: attempt to call global 'nofiar' (a nil value)
Tool = script.Parent colors = {24} local a = 0 function onButton1Down(mouse) a = 1 end function nofair(mouse) a = 0 end function fire(v) Tool.Handle.Fire:play() local vCharacter = Tool.Parent local vPlayer = game.Players:playerFromCharacter(vCharacter) local missile = Instance.new("Part") local spawnPos = vCharacter.PrimaryPart.Position spawnPos = spawnPos + (v * 8) missile.Position = spawnPos missile.Size = Vector3.new(0.2,0.2,0.2) missile.Velocity = v * 641 missile.BrickColor = BrickColor.new(colors[math.random(1, #colors)]) missile.Shape = 0.5 missile.BottomSurface = 0 missile.TopSurface = 0 missile.Name = "Paintball" missile.Elasticity = 0 missile.Reflectance = 0 missile.Friction = 1 local force = Instance.new("BodyForce") force.force = Vector3.new(0,75,0) force.Parent = missile Tool.BrickCleanup:clone().Parent = missile local new_script = script.Parent.Paintball:clone() new_script.Disabled = false new_script.Parent = missile local mesh = Tool.Mesh:clone() mesh.Parent = missile local creator_tag = Instance.new("ObjectValue") creator_tag.Value = vPlayer creator_tag.Name = "creator" creator_tag.Parent = missile missile.Parent = game.Workspace end function check(en) if (Tool.Enabled == false) then return false end if (Tool.Enabled == true) then return true end end Tool.Enabled = true while a == 1 do function onActivated() if not Tool.Enabled then return end local character = Tool.Parent; local humanoid = character.Humanoid if humanoid == nil then print("Humanoid not found") return end local targetPos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit if (check()) then fire(lookAt) wait(0.05) onActivated() end return end end script.Parent.Activated:connect(onActivated) function Equip(mouse) mouse.Button1Down:connect(function() onButton1Down(mouse) end) mouse.Button1Up:connect(function() nofiar(mouse) end) end Tool.Equipped:connect(Equip) |
|
|
| Report Abuse |
|
|
harutsedo
|
  |
| Joined: 11 Oct 2009 |
| Total Posts: 5150 |
|
|
| 13 Sep 2010 06:03 PM |
| Third line from the end. You misspelled nofair(). |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 13 Sep 2010 07:10 PM |
| Oops! It still gives me the same output as it gave me at the beggining though... :/ |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 14 Sep 2010 07:16 AM |
| It's still giving me "Attempt to call a nil value!" I'm so lost!!! I have absolutly no idea what the problem is!! |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 14 Sep 2010 04:52 PM |
B to the U to the M to the P I really wish some one would help me! :P Rap's stupid lol |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
| |
|
purnuttin
|
  |
| Joined: 09 Jul 2010 |
| Total Posts: 257 |
|
|
| 14 Sep 2010 06:32 PM |
| move the function 'nofiar' above where you call it or move where you call it below it. |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 14 Sep 2010 07:32 PM |
| I did what you said but it gave me the same output. UGH!!!! |
|
|
| Report Abuse |
|
|
acid1103
|
  |
| Joined: 28 Jul 2009 |
| Total Posts: 1574 |
|
|
| 14 Sep 2010 07:42 PM |
| I can't believe this thread's been up for two days yet i've gotton NO help!!!! |
|
|
| Report Abuse |
|
|
| |
|