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

Another question, How can I make my projectile script won't hurt the caster?

Since I am making a 2-in-1 game (minigame and magic fighting), I am making magics but I don't like the caster being hurt from their own projectile?

1 answer

So I can't see your code but I'm guessing it works like this.

if Hit and Hit.Parent then
if Hit.Parent:FindFirstChild("Humanoid")  then
Hit.Parent.Humanoid:TakeDamage(25)
end
end

all you need to do is add another condition to it like

if Hit and Hit.Parent and Hit.Parent ~= game.Players.LocalPlayer.Character then
if Hit.Parent:FindFirstChild("Humanoid")  then
Hit.Parent.Humanoid:TakeDamage(25)
end
end

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