Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is it not printing ("dodge") and why is the dummy not doing the dodging animation!?

Asked by
Tizzel40 243 Moderation Voter
5 years ago

so I made a sword. I want is so if the value inside you humanoid called "doging" equals true then when you slash it should print doge and the dummy or player hit by the sword does the animation but its not. plz help me

I have two dummies with the "doging" bool Value

ones value is true and the other is fase. the dummy with the value true should do the dodging animation and print ("doged") and the dummy with the value false should take damage

local Remote = Instance.new("RemoteEvent", script.Parent)

local CanDamage = script.Parent:WaitForChild("CanDamage")

Remote.OnServerEvent:Connect(function(Player)
    CanDamage.Value = true
end)

script.Parent.Handle.Touched:Connect(function(p)
    if CanDamage.Value == true then
        CanDamage.Value = false
       local ehum = p and p:FindFirstChild("Humanoid") or p.Parent:FindFirstChild("Humanoid") or p.Parent.Parent:FindFirstChild("Humanoid")
print("doged")
    if ehum and ehum.Doging.Value == true then--and ehum.Doging.Value == false then
        local doge = ehum:LoadAnimation(script.doge1)
     doge:Play()




    end
    end
end)

why Is It not printing doged AND why when the dummy or player gets hit when this value is true is not doing the animation?

it works when the player has the value as false and it prints "no doge" like this

local Remote = Instance.new("RemoteEvent", script.Parent)

local CanDamage = script.Parent:WaitForChild("CanDamage")

Remote.OnServerEvent:Connect(function(Player)
    CanDamage.Value = true
end)

script.Parent.Handle.Touched:Connect(function(p)
    if CanDamage.Value == true then
        CanDamage.Value = false
       local ehum = p and p:FindFirstChild("Humanoid") or p.Parent:FindFirstChild("Humanoid") or p.Parent.Parent:FindFirstChild("Humanoid")
    if ehum and ehum.Doging.Value == false then--and ehum.Doging.Value == false then
        ehum:TakeDamage(22)
  script.Parent.Handle.Sound:Play()
print("no doge...")
----elseif ehum and ehum.Doging.Value == true then
----    
------  local doge = ehum:LoadAnimation(script.doge1)
------     doge:Play()
--------  script.Parent.Handle.Sound:Play()
------print("doged")
    end
    end
end)

these are two seprate script but my problem is the dodging part.help me..

Answer this question