First Person Shooter, One gun works

I was making a FPS game when i created 2 guns only one of them works.

The output says this:

Players.MelonedSharky.Backpack.M4A1.GunClient:3347: attempt to index nil with ‘WorldPosition’

but i have no idea what that means.

this is the line of code where it has the problem.

local cframe = (Camera.Focus.p - Camera.CoordinateFrame.p).Magnitude <= 1 and“GunFirePoint”…CurrentFireMode).WorldPosition, Position) or“GunFirePoint”…CurrentFireMode).WorldPosition, Position)

thanks if you can help out!

1 Like

instead of WorldPosition, do Position.


now it says?

Players.MelonedSharky.Backpack.M82A1.GunClient:3347: attempt to index nil with ‘Position’

1 Like

Just do model:MoveTo(position) or model:PivotTo(cframe) I tried setting .WorldPosition the other day in a LocalScript and it didn’t work for some reason. I guess you can only set the position/world position property of a model by changing it in the properties of the model?


now it says this:

MoveTo is not a valid member of Attachment “Workspace.MelonedSharky.M82A1.Handle.GunFirePoint1”

ahhh why is this so complicatedf

1 Like

also i did something and now it says this in another script:

ReplicatedStorage.Modules.ProjectileHandler:1813: attempt to index nil with ‘PivotTo’

(theprevious out put is gone)

post the line that is erroring

for some reason the other gun stopped working too so i went to place history and now im back at problem numero 1

I appreciate how you have given me zero lines of code and instead of deciding to let me help you, you decided to change the place version for no reason :moyai:

sorry i changed the place version before i saw your comment

just goto the saved place history on the website and revert it