How do i make a particle emit from the place where I click on a basic gun?
Script1:
script.Parent.RemoteEvent.OnServerEvent:Connect(function(player, target)
script.Parent.Handle.Fire:Play()
if target.Parent:FindFirstChild(“Humanoid”) then
target.Parent.Humanoid:TakeDamage(20)
if target.Parent:Isa(“Part”) then
target.Parent.Humanoid:TakeDamage(20)
end
end
end)
(Local) Script2:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
script.Parent.Activated:Connect(function()
local target = mouse.Target
if target.Parent:FindFirstChild(“Humanoid”) then
script.Parent.RemoteEvent:FireServer(target)
local ImpactPaticle = script.Parent.ImpactParticle:Clone()
ImpactPaticle.Parent = target
ImpactPaticle.Enabled = true
wait(0.1)
ImpactPaticle:Destroy()
end
end)