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

The Damage won’t work while being lerped?

Asked by 6 years ago
game.ReplicatedStorage.attack.OnServerEvent:connect(function(plr)
    wait()

local p1= script["Realistic fire"]:Clone()
p1.Name = 'p1' 
p1.Parent = plr.Character


local p2 = script["Realistic fire"]:Clone()
p2.Name = 'p2' 
p2.Parent = plr.Character    

local p3 = script["Realistic fire"]:Clone()
p3.Name = 'p3' 
p3.Parent = plr.Character    

local p4 = script["Realistic fire"]:Clone()
p4.Name = 'p4' 
p4.Parent = plr.Character    






local weld1 = Instance.new('Weld')
weld1.Parent = plr.Character
weld1.Part0 = plr.Character.UpperTorso
weld1.Part1 = p1
weld1.C1 = CFrames[1]
local weld2 = Instance.new('Weld')
weld2.Parent = plr .Character
weld2.Part0 = plr.Character.UpperTorso
weld2.Part1 = p2
weld2.C1 = CFrames[1]
local weld3 = Instance.new('Weld')
weld3.Parent = plr.Character
weld3.Part0 = plr.Character.UpperTorso
weld3.Part1 = p3
weld3.C1 = CFrames[1]
local weld4 = Instance.new('Weld')
weld4.Parent = plr.Character 
weld4.Part0 = plr.Character.UpperTorso
weld4.Part1 = p4
weld4.C1 = CFrames[1]
    local anim = plr.Character.Humanoid:LoadAnimation(script.Animation)
coroutine.resume(coroutine.create(function()

        wait()

        p1.Touched:Connect(function(hit)
print('hfdsha')

        end)

end))
    for i = 0,1,0.1 do 
        wait()
            anim:Play()
    weld1.C1 = CFrames[1]:lerp(CFrames[2],i)
    weld2.C1 = CFrames[1]:lerp(CFrames[3],i)
    end    
    wait(1.5)

        for i = 0,1,0.1 do 
        wait()            
            anim:Play()
    weld1.C1 = CFrames[2]:lerp(CFrames[4],i)
    weld2.C1 = CFrames[3]:lerp(CFrames[4],i)

    end    


end)

You see in the script one of the parts should do damage even while being lerped pls help

Answer this question