Apologies for the terrible coding.
0 Errors, but the leg function seems incorrect. Any other better ways I can be doing this?
local uis = game:GetService("UserInputService")
local inCombat = false
local player = game.Players.LocalPlayer
local char = player.Character
local one = Instance.new("Animation")
one.AnimationId = "rbxassetid://1255742316"
local onePlayer = char.Humanoid:LoadAnimation(one)
uis.InputBegan:connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.G then
if inCombat == false then inCombat = true
onePlayer:Play()
char.LeftLowerLeg.Touched:connect(function(hit)
if inCombat == false then end
if hit:FindFirstChild("Humanoid") ~= nil then end
if hit:FindFirstChild("Humanoid") then
local humanoid = hit:FindFirstChild("Humanoid")
humanoid:TakeDamage(10)
end
end)
wait(2)
inCombat = false
end
end
end)**

1 comment
Thanks!