Spa_rkk
(spark)
May 20, 2022, 11:38pm
#1
Im making a gun and it creates a part were you click, how would I make that part kill something?
script.Parent.Main.Shoot.OnServerEvent:Connect(function(player, mousePos)
local bullet = Instance.new("Part")
bullet.Shape = "Ball"
bullet.Size = Vector3.new(0.4,0.4,0.4)
bullet.Parent = game.Workspace
bullet.Position = mousePos
bullet.Anchored = true
bullet.Transparency = 1
end)
1 Like
Have you decided on how you want the gun to work:
For projectile, use fastcast
For Hitscan use raycast
2 Likes
Spa_rkk
(spark)
May 20, 2022, 11:40pm
#3
I know but I do-not know how to do that stuff and its difficult to find out how.
1 Like
Yes, but I need to know which one you want to use to help you
Spa_rkk
(spark)
May 20, 2022, 11:44pm
#5
hitscan i guess (fjsafhjdksfhdjkfhdsjkfhdsjk)
Projectile will make the game more realistic, and fastcast is a very reliable and handy software for shooter games.
Projectile means the gun shoots physical bullets, while hitscan means the gun uses raycast.
Spa_rkk
(spark)
May 21, 2022, 1:02am
#8
:o real bullets? how? I mean I know it’s possible but isin’t that very hard?
I mean like actually have a part that flies from the gun. this is the link
1 Like
Yeah I know? That’s why I suggested it, and plus it doesn’t just need to be raycast for hitscan, but it is recommended. Intro to Raycasting Here is the old wiki page for it, and here is the docs for FastCast API fastcast