Here's the collision script

beam = script.Parent
rep = game.ReplicatedStorage
play = game.Players.LocalPlayer
char = play.Character
hum = char.Humanoid
child = char:GetChildren()
local ten = true

beam.Touched:Connect(function(hit)
	local class = hit:GetChildren()
	if not ten then return end
	local ehum = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:FindFirstChild("Humanoid")
	if ehum and ehum ~= hum then
		ehum:TakeDamage(20)
	else if class ~= "MeshPart" then
	local explosion = rep.Explosion:Clone()
	explosion.Parent = workspace
	explosion.CFrame = beam.CFrame
	beam:Destroy()
	local sound = Instance.new("Sound")
	sound.SoundId = "rbxassetid://833855896"
	sound.MaxDistance = 200
	sound.Parent = explosion
	sound:Play()
	for i = 1, 5 do
	explosion.Mesh.Scale = explosion.Mesh.Scale * 1.5
	wait(0.05)
	explosion.Transparency = explosion.Transparency + 0.1
	end
	explosion.Transparency = 1
	wait(0.5)
	explosion:Destroy()
	end
	wait()
	ten = true
	end
end)

GIF of what happens https://gyazo.com/814dcde01f5247f299e3aa11317758ee

The projectile collides fine with any humanoid excluding the humanoid of the person firing the laser, but I can't seem to get the projectile to stop colliding with my player model. Help would be appreciated.

2 comments

0

Just check if the "hit" isn't the character.

0

Thanks, I tried doing that earlier but it wasn't working, got it to work now.