local w=true local z=true function dmg(w)script.Parent.Humanoid:TakeDamage(w.damage.Value)script.Parent.Humanoid.Died:connect(function()if not script.Parent.Humanoid:FindFirstChild("\099\114\101\097\116\111\114")then if w:FindFirstChild("\099\114\101\097\116\111\114")then if(w:WaitForChild("\099\114\101\097\116\111\114",1)).Value:FindFirstChild("\108\101\097\100\101\114\115\116\097\116\115")then((w:WaitForChild("\099\114\101\097\116\111\114",1)):Clone()).Parent=script.Parent.Humanoid end end end end)end;(script.Parent:WaitForChild("\072\117\109\097\110\111\105\100",1)).Touched:connect(function(y,o)local c=game.Players:GetPlayerFromCharacter(script.Parent)if y.Name=="\067\097\110\110\111\110 \083\104\111\116"then if w==true then w=false if(y:WaitForChild("\099\114\101\097\116\111\114",1)).Value~=c then if script.Parent.Humanoid.Health~=0 then if(c:WaitForChild("\065\110\116\105\084\101\097\109\075\105\108\108",1)).Value==true then if c.TeamColor~=(y:WaitForChild("\099\114\101\097\116\111\114",1)).Value.TeamColor then dmg(y)end else dmg(y)end end end wait(.033333333333333)w=true end elseif y.Name=="\080\101\108\108\101\116"then if z==true then w=false if(y:WaitForChild("\099\114\101\097\116\111\114",1)).Value~=c then if script.Parent.Humanoid.Health~=0 then if(c:WaitForChild("\065\110\116\105\084\101\097\109\075\105\108\108",1)).Value==true then if c.TeamColor~=(y:WaitForChild("\099\114\101\097\116\111\114",1)).Value.TeamColor then dmg(y)end else dmg(y)end end end wait(.2)w=true end end end)
--[[
	
	The golden hit detection script! For experimental mode, mainly.
	Rather than detect superball and slingshot hits by having the 
	ball look for a player in any object it touches, this script
	makes the player check if any object it touches is a ball or
	slingshot projectile. It works better because it has all your 
	body parts (about 6 or 7 parts for R6, many more for R15) 
	checking for hits, rather than just one part!
	
--]]

local ds2 = true
local dp2 = true

function dmg(Part)
	script.Parent.Humanoid:TakeDamage(Part.damage.Value)
	script.Parent.Humanoid.Died:connect(function()
		if not script.Parent.Humanoid:FindFirstChild("creator") then
			if Part:FindFirstChild("creator") then
				if Part:WaitForChild("creator", 1).Value:FindFirstChild("leaderstats") then
					Part:WaitForChild("creator", 1):Clone().Parent = script.Parent.Humanoid
				end
			end
		end
	end)
end

script.Parent:WaitForChild("Humanoid", 1).Touched:connect(function(Part, Limb)
	local player = game.Players:GetPlayerFromCharacter(script.Parent)
	if Part.Name == "Cannon Shot" then
		if ds2 == true then
			ds2 = false
			if Part:WaitForChild("creator", 1).Value ~= player then
				if script.Parent.Humanoid.Health ~= 0 then
					if player:WaitForChild("AntiTeamKill", 1).Value == true then
						if player.TeamColor ~= Part:WaitForChild("creator", 1).Value.TeamColor then
							dmg(Part)
						end
					else
						dmg(Part)
					end
				end
			end
			wait(1 / 30)
			ds2 = true
		end
	elseif Part.Name == "Pellet" then
		if dp2 == true then
			ds2 = false
			if Part:WaitForChild("creator", 1).Value ~= player then
				if script.Parent.Humanoid.Health ~= 0 then
					if player:WaitForChild("AntiTeamKill", 1).Value == true then
						if player.TeamColor ~= Part:WaitForChild("creator", 1).Value.TeamColor then
							dmg(Part)
						end
					else
						dmg(Part)
					end
				end
			end
			wait(0.2)
			ds2 = true
		end
	end
end)
