--[[ LawlR fix ]]
--

local ds = game:GetService("Debris")
local ps = game:GetService("Players")

local rng = Random.new()

local potato = script.Parent
local potatoOwner = potato:WaitForChild("Owner").Value

local ownerName = potatoOwner.Name
local dmg = 49
local lifetime = 500


local function tagHum(hum)
	local tag = Instance.new("ObjectValue")
	tag.Name = "creator"
	tag.Value = potatoOwner
	tag.Parent = hum
	ds:AddItem(tag, 2)
end

local function isTeamMate(hitPlr)
	return (hitPlr and potatoOwner and not hitPlr.Neutral and not potatoOwner.Neutral and hitPlr.TeamColor == potatoOwner.TeamColor)
end


potato.Touched:Connect(function(hit)
	local hitHum = hit.Parent:FindFirstChildWhichIsA("Humanoid") or hit.Parent.Parent:FindFirstChildWhichIsA("Humanoid")
	if hitHum and hitHum.Health > 0 then
		local hitChr = hitHum.Parent
		if hitChr then
			if hitChr.Name ~= ownerName then
				local hitPlr = ps:GetPlayerFromCharacter(hitChr)
				if hitPlr and isTeamMate(hitPlr) then
					return
				end
				tagHum(hitHum)
				hitHum:TakeDamage(dmg)
				hitHum.WalkSpeed = 0
				wait(3)
				hitHum.WalkSpeed = 16
			end
		end
	end
end)

ds:AddItem(potato, lifetime)
