function blow(hit)
if ching == true then return end
local humanoid = hit.Parent:findFirstChild("Human")
local vCharacter = Tool.Parent
local vPlayer = game.Players:playerFromCharacter(vCharacter)
if humanoid~=nil then
ching = true
print("SWORD HIT")
tagHumanoid(humanoid, vPlayer)
local damage = math.random(4,9)
local slash_damage = math.random(4,9)
local lunge_damage = math.random(7,11)
humanoid:TakeDamage(damage)
local part = Instance.new("ScreenGui")
local part2 = Instance.new("TextLabel")
part2.BackgroundTransparency = 1
part2.Size = UDim2.new(0,50,0,50)
part2.FontSize = "Size14"
part2.Position = UDim2.new(0.5,0,0.25,0)
part2.Parent = part
part.Parent = vPlayer.PlayerGui
if (damage == 0) then
part2.TextColor3 = Color3.new(0/255,102/255,255/255)
else
part2.TextColor3 = Color3.new(255/255,255/255,255/255)
end
part2.Text = ""..damage..""
wait(0.8)
ching = false
part:remove()
wait(.1)
untagHumanoid(humanoid)
end
end
function critical (damage, human)
v = math.random (1,2)
if v == 1 then damage = math.random (200,300)
if v == 1 then slash_damage = math.random (200,300)
if v == 1 then lunge_damage = math.random (200,300)
end
end
end
end
The critical is set high for testing purposes, the critical does not work right now :/ |