Here is the script

local hitable = true
			White.Touched:Connect(function(hitpart)
				if hitpart.Parent:FindFirstChild("Humanoid") then
					local enemyh = hitpart.Parent:FindFirstChild("Humanoid")
					if enemyh.Parent.Name ~= plr.Character.Name and hitable == true then
						local Humanoid = hitpart.Parent:WaitForChild("Humanoid")
						local creator_tag = Instance.new("ObjectValue",Humanoid)
						creator_tag.Value = plr
						creator_tag.Name = "creator"
						Humanoid:TakeDamage(60)
						hitable = false
						wait(0.05)
						if Humanoid ~= nil then
							local tag = Humanoid:findFirstChild("creator")
							if tag ~= nil then
								tag.Parent = nil
							end
						end
						wait(1)
						hitable = true
					end
				end
			end)
		end)

3 comments

0

Btw, ignore the "tag" part, it's just a quest system

0

Change line 5 to "if enemyh.Parent ~= plr.Character then"? Hopefully that works. If not, is the script local or a server script?

0

It still doesn't work, if i throw the ball and it hits nothing, then it doesn't hit me. But if it finds an enemy, it hits me together