I’m trying to make it so that whenever I shoot, a bullet hole (transparent part with decal on) goes to the mouse position, but for some reason the position isn’t changing and all of the bullets are going to 1 area, could someone help?
Also MouseHit is mouse.Target and mousePosition is mouse.Hit
Server Script
fire_event.OnServerEvent:Connect(function(player, mouseHit, mousePosition)
local bulletHole = game.ReplicatedStorage.BulletHole:Clone()
bulletHole.Parent = workspace
bulletHole.Position = Vector3.new(mousePosition)
if mouseHit ~= "nil" and player.Character.Humanoid.Health > 0 then
fireEffect()
if mouseHit.Parent:FindFirstChild("Humanoid") and mouseHit.Parent:FindFirstChild("Humanoid").Health > 0 and player.Character.Humanoid.Health > 0 and mouseHit.Parent then
if mouseHit.Name == "Head" then
mouseHit.Parent:FindFirstChild("Humanoid"):TakeDamage(40)
fire_event:FireClient(player)
if mouseHit.Parent:FindFirstChild("Humanoid").Health == 0 then
killed_player_event:FireClient(mouseHit.Parent)
end
else
mouseHit.Parent:FindFirstChild("Humanoid"):TakeDamage(30)
fire_event:FireClient(player)
if mouseHit.Parent:FindFirstChild("Humanoid").Health == 0 then
killed_player_event:FireClient(mouseHit.Parent)
end
end
end
else
fireEffect()
end
end)