local attackCooldown = 1 local attackWindup = 0.5 local attackRange = 3 local attackDamage = 20
local char = script.Parent.Parent local hum = char:WaitForChild("Humanoid") local originalWalkSpeed = hum.WalkSpeed
local canAttack = true
script.Parent.AttackRemote.Event:Connect(function(plrRoot)
if not canAttack then return end
canAttack = false
hun.WalkSpeed = 0.1
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://7209529782"
local playAnim = hum:LoadAnimation(anim)
playAnim:Play()
wait(attackWindup)
local newDistance = (char.HumanoidRootPart.Position - -plrRoot.Position).magnitude
if newDistance <= attackRange + 5 then
if plrRoot.parent.Player.isBlocking.Value == true then
attackDamage *= 0.5
end
plrRoot.Parent.Humanoid:takeDamage(attackDamage)
wait(attackCooldown)
hum.WalkSpeen = orininalWalkSpeed
canAttack = true
end
end)

13 comments
still broke
You also misspelled WalkSpeed with WalkSpeen and originalWalkSpeed with orininalWalkSpeed. It should be hum.WalkSpeed = originalWalkSpeed
In the future, if you get errors make sure to re-read your code to make sure any capitals are capitalized and any misspellings are changed.
yeah, i fixed all that and it still doesnt work.
What is the error message that you have gotten now?
same error massage
just with caps
Workspace.Dummy.Controller.Attack:17: attempt to index nil with 'WalkSpeed'
Would you mind providing me with the line of code where the error appears. You can do this by clicking on the error message and it will direct you to the line of code where the error occurred.
hun.WalkSpeed = 0.1
You misspelled hum with hun. So it should be hum.WalkSpeed = 0.1
I hope this solved your issue.
tysm