0rka
|
  |
| Joined: 26 Dec 2013 |
| Total Posts: 1070 |
|
|
| 25 Mar 2014 02:50 PM |
if tracers == true then -- A bullet will not be created unless tracers is set to true, this helps prevent lag local bullet = Instance.new("Part", game.Workspace) -- Create the bullet bullet.FormFactor = "Custom" bullet.CanCollide = false bullet.BrickColor = BrickColor.new("Dark stone grey") bullet.Size = Vector3.new(.2, .2, .2) local light = Instance.new("BillboardGui", bullet) -- Create the light local lightFrame = Instance.new("ImageLabel", light) light.Size = UDim2.new(6, 0, 6, 0) lightFrame.BackgroundTransparency = 1 lightFrame.Image = "http://www.roblox.com/asset/?id=43708803" lightFrame.Size = UDim2.new(1, 0, 1, 0) light.Adornee = bullet local character = tool.Parent local spawnPos = character.PrimaryPart.Position local humanoid = character.Humanoid local targetpos = humanoid.TargetPoint local lookAt = (targetPos - character.Head.Position).unit --[[ this line is the error; it says Players.0rka.Backpack.SVT-40 Ray.Teutonic Shooter:59: bad argument #1 to '?' (Vector3 expected, got nil) 15:46:48.172 - Script 'Players.0rka.Backpack.SVT-40 Ray.Teutonic Shooter', Line 59 15:46:48.173 - stack end]] spawnPos = spawnPos + (lookAt * 8) bullet.Position = spawnPos bullet.Velocity = lookAt * 6000 local force = Instance.new("BodyForce") force.force = Vector3.new(0, bullet:getMass() * 196, 0) force.Parent = part wait(.4) bullet:Remove() end |
|
|
| Report Abuse |
|
|
|
| 25 Mar 2014 02:51 PM |
good job on just pasting the script
maybe next time add a description on what you need help with |
|
|
| Report Abuse |
|
|
0rka
|
  |
| Joined: 26 Dec 2013 |
| Total Posts: 1070 |
|
|
| 25 Mar 2014 02:53 PM |
I did, if you'd read it. --[[ this line is the error; it says Players.0rka.Backpack.SVT-40 Ray.Teutonic Shooter:59: bad argument #1 to '?' (Vector3 expected, got nil) 15:46:48.172 - Script 'Players.0rka.Backpack.SVT-40 Ray.Teutonic Shooter', Line 59 15:46:48.173 - stack end]]
Get out moron. |
|
|
| Report Abuse |
|
|
0rka
|
  |
| Joined: 26 Dec 2013 |
| Total Posts: 1070 |
|
| |
|
|
| 25 Mar 2014 02:58 PM |
| I can't test anything at the moment, but my suspicion is that Humanoid.TargetPoint is nil unless the player is walking somewhere. Therefore, targetPos is nil. I could be wrong, but try testing to see if it is not nil before performing arithmetic. |
|
|
| Report Abuse |
|
|
0rka
|
  |
| Joined: 26 Dec 2013 |
| Total Posts: 1070 |
|
|
| 25 Mar 2014 02:59 PM |
| Lol, silly capitalization error. |
|
|
| Report Abuse |
|
|
| |
|