Ad
Log in to vote
0

Im making a m1 combo script but each time I do, My output shows these errors like?

Asked by 2 months ago

RightGrip is not a valid member of Part "cloud_1071939507.. Right Arm" and FakeHandle is not a valid member of Tool "cloud_1071939507.. Buthersaw"

Here's my code if you need it LOCAL SCRIPT`` local character = script.parent local humanoid = character.Humanoid local player = game.Players.LocalPlayer

local uis= game:GetService("UserInputService")

local remote = game.ReplicatedStorage.CombatEvent

local LastTimeM1 = 0 local LastM1End = 0 local combo = 1

local canComboFE = true

local punchanims = { 'rbxassetid://11690130316',--1 Default F1 'rbxassetid://11690132757',-- 2 Default F2 'rbxassetid://11690136674',-- 3 Default F3 'rbxassetid://11690140420', --4 Default F4 'rbxassetid://11694901963'--5 Default F5

} local airanims = { 'rbxassetid://11694955935',--1 Default Air 1 'rbxassetid://11694984787'--2 Default Air 2 }

--hb is hitbox local function hb(size, cframe, ignore, char) local hb = Instance.new("Part",workspace.Fx) hb.Anchored = true hb.CanCollide = false hb.Transparency = .6 hb.Name = "hb" hb.Material = Enum.Material.ForceField hb.CanQuery = false hb.Size = size hb.CFrame = cframe

local con
con = hb.Touched:Connect(function()
    con:Disconnect() 
end)

local lasttarg-- last target

for i, v in pairs(hb:GetTouchingParts()) do
    if v.Parent:FindFirstChild("Humanoid") and table.find(ignore, v.Parent) == nil then
        if lasttarg then
            if (lasttarg.Position - char.PrimaryPart.Position).Magnitude > (v.Position - char.PrimaryPart.Position) then
                lasttarg = v.Parent.PrimaryPart
            end
            lasttarg = v.Parent.PrimaryPart
        end
    end
end

hb:Destroy()
if lasttarg then
    return lasttarg.Parent
else
    return nil
end

end

--Input for m1(m1 cooldown etc) uis.InputBegan:Connect(function(input,gpe) if gpe then return end if input.UserInputType == Enum.UserInputType.MouseButton1 and tick()- LastTimeM1 >.3 and tick() -LastM1End > .7 then if tick()- LastTimeM1 > .7 then combo = 1 end

    LastTimeM1 = tick()

    local animation = Instance.new("Animation",workspace.Fx)
    local air = nil

    if uis:IsKeyDown("Space") and combo == 4 and canComboFE then
        canComboFE = false
        animation.AnimationId = airanims[1]

        air = "Up"
    elseif not uis:IsKeyDown("Space") and combo == 5 and not canComboFE then
        animation.AnimationId = airanims[2]
        air = "Down"
    else
        animation.AnimationId = punchanims[combo]
    end

    local load = humanoid:LoadAnimation(animation)
    load:Play()

    animation:Destroy() 

    local hitTarg = hb(Vector3.new(4,6,4), character.PrimaryPart.CFrame * CFrame.new(0,0,-3), {character}, character)

    if hitTarg then
        local data = {
            ["Target"] = hitTarg,
            ["Character"] = character,
            ["Combo"] = combo,
            ["Air"] = air,
            ["Action"] = "m1",

        }

        remote:FireServer(data)
    end

    if combo == #punchanims then
        combo = 1
        LastM1End = tick()
    else
        combo += 1
    end

    humanoid.WalkSpeed = 0
    wait(.4)
    humanoid.WalkSpeed = 16
end

end)

humanoid.StateChanged:Connect(function(old,new) if new == Enum.HumanoidStateType.Landed then canComboFE = true

    end 

end)

uis.JumpRequest:Connect((function() if tick() - LastTimeM1 < 1 then humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping, false) else humanoid:SetStateEnabled(Enum.HumanoidStateType.Jumping,true) end end))

and SCRIPT local remote = game.ReplicatedStorage.CombatEvent

remote.OnServerEvent:Connect(function(client, data) if data.Action == "m1" then data.Target.Humanoid:TakeDamage(4) if data.Air == "Up" then --Moves Player up 4 studs local bp = Instance.new("BodyPosition") bp.Position = data.Character.PrimaryPart.Position + Vector3.new(0,30,0) bp.P = 1200 bp.MaxForce = Vector3.new(99999,99999,99999) bp.D = 200 bp.Name = "Position" bp.Parent = data.Character.PrimaryPart game.debris:AddItem(bp,1)

        --Moves enemy by 4 studs
        local bp = Instance.new("BodyPosition")
        bp.Position = data.Target.PrimaryPart.Position + Vector3.new(0,30,0)
        bp.P = 1200
        bp.MaxForce = Vector3.new(99999,99999,99999)
        bp.D = 200
        bp.Name = "Position"
        bp.Parent = data.Target.PrimaryPart
        game.debris:AddItem(bp,1)

        --Downslam
    elseif data.Air == "Down" then
        for i,v in pairs(data.Target.PrimaryPart:GetChildren()) do
            if v:IsA("BodyMover") then
                v:Destroy()
            end 
        end
        local bv = Instance.new("BodyVelocity", data.Target.PrimaryPart)
        bv.Velocity = (data.Character.PrimaryPart.CFrame.LookVector * 1 - Vector3.new(0,2,0)) * 25
        bv.MaxForce = Vector3.new(99999,99999,99999)
        bv.Name = "Velocity"
        game.Debris:AddItem(bv,.2)


    end
else if data.Combo == 5 then

--m1 combo LESS GO local bv = Instance.new("BodyVelocity", data.Character.PrimaryPart) bv.Velocity = data.Character.PrimaryPart.CFrame.LookVector * 10 bv.MaxForce = Vector3.new(99999,99999,99999) bv.Name = "Velocity" game.Debris:AddItem(bv,.2)

        local bv = Instance.new("BodyVelocity", data.Target.PrimaryPart)
        bv.Velocity = data.Character.PrimaryPart.CFrame.LookVector * 75
        bv.MaxForce = Vector3.new(99999,99999,99999)
        bv.Name = "Velocity"
        game.Debris:AddItem(bv,.2)
    else 
        --Normal m1(no combo)
        local bv = Instance.new("BodyVelocity", data.Character.PrimaryPart)
        bv.Velocity = data.Character.PrimaryPart.CFrame.LookVector * 10
        bv.MaxForce = Vector3.new(99999,99999,99999)
        bv.Name = "Velocity"
        game.Debris:AddItem(bv,.2)
        local bv = Instance.new("BodyVelocity", data.Target.PrimaryPart)
        bv.Velocity = data.Target.PrimaryPart.CFrame.LookVector * 10
        bv.MaxForce = Vector3.new(99999,99999,99999)
        bv.Name = "Velocity"
        game.Debris:AddItem(bv,.2)

    end 
end

end)

Answer this question