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?
COMMUNITY QUESTION
Another question, How can I make my projectile script won't hurt the caster?
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.
