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

How do I fix this?

(Idk a title for this srry) I just don't know why this function wont work, it's just one of those problems I have absolutely no idea how to fix. So, it fires the function when it hits terrain or a part but when it hits me or any other charater it doesn't. Example of what happens: https://gyazo.com/9384cd236932b75f0ea378f98345437e

Bullet.Touched:connect(function(Part)
	if Part and Part.Name == "Part" or Part.Name == "Terrain" or Part.Parent.Humanoid and not Part.Parent.Humanoid.Parent.Name == user.Name then
		HasExploded = false
		ExplosionPosition = Bullet.Position
		Explode()
	end
end)

1 answer

local Bullet = parent ex.(workspace.model.bullet)
function onTouch(part)
    if Part and Part.Name == "Part" or Part.Name == "Terrain" or Part.Parent.Humanoid and not Part.Parent.Humanoid.Parent.Name == user.Name then
        HasExploded = false
        ExplosionPosition = Bullet.Position
        Explode()
    end
end
Bullet.Touched:connect(onTouch)

Call parent the location of the bullet. Hope this works or is what you want.

1 comment

0

I already have the Bullet as Bullet = script.Parent

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