function TagHumanoid(P,z)local k=Instance.new("\079\098\106\101\099\116\086\097\108\117\101")k.Name="\099\114\101\097\116\111\114"k.Value=z debris:AddItem(k,.3)k.Parent=P end function UntagHumanoid(P)for P,z in pairs(P:GetChildren())do if z:IsA("\079\098\106\101\099\116\086\097\108\117\101")and z.Name=="\099\114\101\097\116\111\114"then z:Destroy()end end end function TextEffects(P,z,k,B,a)P:TweenPosition(UDim2.new(0,math.random(-40,40),0,-z),k,B,a)wait(.5)for z=1,60,1 do P.TextTransparency=P.TextTransparency+.016666666666667 P.TextStrokeTransparency=P.TextStrokeTransparency+.016666666666667 wait(.016666666666667)end P.TextTransparency=P.TextTransparency+1 P.TextStrokeTransparency=P.TextStrokeTransparency+1 P.Parent:Destroy()end function DynamicText(P,z,k)local B=Instance.new("\066\105\108\108\098\111\097\114\100\071\117\105",k.Parent.Head)B.Size=UDim2.new(0,50,0,100)local a=Instance.new("\084\101\120\116\076\097\098\101\108",B)B.AlwaysOnTop=true a.TextColor3=Color3.fromRGB(255,0,0)a.Text=P a.Font=Enum.Font.SourceSans a.TextStrokeTransparency=0 a.Size=UDim2.new(1,0,1,0)a.Position=UDim2.new(0,0,0,0)a.BackgroundTransparency=1 B.Adornee=B.Parent if P<z then a.TextSize=28 a.TextColor3=Color3.new(1,0,0)elseif P>=z then a.TextSize=32 a.TextColor3=Color3.new(1,1,0)end spawn(function()TextEffects(a,85,Enum.EasingDirection.Out,Enum.EasingStyle.Quint,.75)end)end function DamageAndTagHumanoid(P,z,k)hit:FireClient(P)UntagHumanoid(handle)z:TakeDamage(k)TagHumanoid(z,P)end

function TagHumanoid(humanoid, player)
	local Creator_Tag = Instance.new("ObjectValue")
	Creator_Tag.Name = "creator"
	Creator_Tag.Value = player
	debris:AddItem(Creator_Tag, 0.3)
	Creator_Tag.Parent = humanoid
end

function UntagHumanoid(humanoid)
	for i, v in pairs(humanoid:GetChildren()) do
		if v:IsA("ObjectValue") and v.Name == "creator" then
			v:Destroy()
		end
	end
end

function TextEffects(element, floatAmount, direction, style, duration)
	element:TweenPosition(UDim2.new(0, math.random(-40, 40), 0, -floatAmount), direction, style, duration)
	wait(0.5)

	for i = 1, 60 do
		element.TextTransparency = element.TextTransparency + 1/60
		element.TextStrokeTransparency = element.TextStrokeTransparency + 1/60
		wait(1/60)
	end

	element.TextTransparency = element.TextTransparency + 1
	element.TextStrokeTransparency = element.TextStrokeTransparency + 1
	element.Parent:Destroy()
end

function DynamicText(damage, criticalPoint, humanoid)
	local bill = Instance.new("BillboardGui", humanoid.Parent.Head)
	bill.Size = UDim2.new(0, 50, 0, 100) 
	local part = Instance.new("TextLabel", bill) 
	bill.AlwaysOnTop = true
	part.TextColor3 = Color3.fromRGB(255, 0, 0)
	part.Text = damage
	part.Font = Enum.Font.SourceSans
	part.TextStrokeTransparency = 0
	part.Size = UDim2.new(1, 0, 1, 0) 
	part.Position = UDim2.new(0, 0, 0, 0) 
	part.BackgroundTransparency = 1
	bill.Adornee = bill.Parent
			
	if damage < criticalPoint then
		part.TextSize = 28
		part.TextColor3 = Color3.new(1, 0, 0)
	elseif damage >= criticalPoint then
		part.TextSize = 32
		part.TextColor3 = Color3.new(1, 1, 0)
	end 
	
	spawn(function()
		TextEffects(part, 85, Enum.EasingDirection.Out, Enum.EasingStyle.Quint, 0.75)
	end)
end

function DamageAndTagHumanoid(player, humanoid, damage)
	hit:FireClient(player)
	UntagHumanoid(handle)
	humanoid:TakeDamage(damage) TagHumanoid(humanoid, player)
end
