Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[Solved] how to script a bullet coming out of the barrel of a gun?

i already am using ray casting to do damage i just need to show the bullet the script i am thinking of goes kind of like this:

script.Parent.Parent.Equipped(function()
	script.Parent.Parent:Equipped(function()
		local bullet = game.ServerStorage.Bullet:Clone()
		bullet.Parent = script.Parent.Parent
		bullet.Position = script.Parent.Parent.Barrel.Position
	end)
end)

after this i dont know how to make it move in the direction where the mouse is pointed plz help

2 comments

0

I also sent a question about a gun working in studio, but when I publish it, it is in the backpack and in his hand, but does not fire. I can share my code on the bullet that goes out the barrel. Does your code work for the ray tracing when you publish and play it? I will also send a roblox friend invite

1 answer

It's difficult to say, however, if you're making a gun, it is a little outdated but, you can check AlvinBlox's tutorial. It's in depth and it works, some parts are broken, but it'll show you how to code that part you need.

3 comments

0

do you know what part it is at? the tutorial it 3 hours so i don't really want to search through that much amount of footage

0

nvm i found it, its 1:29:00

0

yeah it is way too confusing i just cant understand it

This discussion is preserved as it was. New answers, comments, and votes are closed.