Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix this error? [ UNSOLVED ]

Asked by 9 years ago

So, this is part of a gun I have.

I have been getting 2 errors 1 client-Sided And 1 server-sided

Here are the errors: Client Error:

18:29:38.358 - attempt to multiply a Vector3 with an incompatible value type or nil; returning new zero-vector

And here is the server error:

18:29:41.330 - Players.Player1.Backpack.Net Gun.NetGunScript:10: bad argument #1 to '?' (Vector3 expected, got nil)
18:29:41.332 - Script 'Players.Player1.Backpack.Net Gun.NetGunScript', Line 10 - global drawbeam
18:29:41.334 - Script 'Players.Player1.Backpack.Net Gun.NetGunScript', Line 54
18:29:41.335 - Stack End

Here is line 10, and 54:

Line 10:

local dist = (beamstart-beamend).magnitude

Line 54:

drawbeam (fakestartpose, endpos, BrickColor.new("Grime"), .25)

And finally, here is the function where endpos is defined as: ( not the whole function )

event.OnServerEvent:connect(function(player, ...)
    local tuple = {...} -- 
    if tuple[1] == "Fire" then
        local endpos = tuple[2] 

If you need more information then please tell me, and kinda tell me what I should give ( Such as more below line 54, or more above it, etc.

1
By the looks of it your trying to code the gun from the tutorials? The video does show you everything and if followed exactly then should work NinjoOnline 1146 — 9y
0
I followed it exactly ggggyourface23 63 — 9y

Answer this question