So when i shoot my gun i want a shell to come out this shell spawns at 0,0,0 and it clones to workspace but i want it to drop from the gun to the ground i have already tryed position it heres the code.
This is the function where the shells meant to come out
local y = game.Workspace local z = game.ServerStorage["DeagleShell"] z:Clone().Parent = y z.Position = Vector3.new(script.Parent.Barrel) end
May someone help me fix this please heres a screen shot of where they spawn when i shoot
And then they stack ontop of the second shell
May someone Help me thanks!
Hey Prestory,
You cannot create a Vector3 by supplying the barrel. You must supply three numbers as arguments, like so:
Vector3.new(10, 5, 13)
See the documentation page for Vector3 here.
To achieve the effect you want, you should access the barrel's CFrame property, again like so:
z.CFrame = script.Parent.Barrel.CFrame
You may also benefit from reading NoahWillCode's Clean and Tidy as well as this forum post.
Have a nice day!
Best regards, tkcmdr
local y = game.Workspace local z = game.ServerStorage["DeagleShell"] z:Clone().Parent = y z.CFrame = script.Parent.Barrel.CFrame end