So this script worked before, I know it. It just won't work now, I don't understand why.

  • It's supposed to push the player backwards when the mouse is directly on the character
  • It's supposed to play an animation

It doesn't do neither. Could anyone help me please?

wait()

local User = game.Players.LocalPlayer



local mouse = User:GetMouse()



Animation = Instance.new("Animation")



Animation.AnimationId = "http://www.roblox.com/Asset?ID==198804093"



Animation.Name = "Forcepush"



local animTrack = User.Character.Humanoid:LoadAnimation(Animation)



forceValue = 200







function ForcePush(key)

    if key == "f" then -- Checks if the button is F

        if mouse.Target ~= nil and mouse.Target:IsA("BasePart") then 

            if mouse.Target.Parent:IsA("Hat") then 

                animTrack:Play()

                mouse.Target.Parent.Parent.Torso.Velocity = (workspace.CurrentCamera.CoordinateFrame.lookVector*forceValue) + Vector3.new(0,70,0)

            elseif mouse.Target.Parent:FindFirstChild("Humanoid") then

                animTrack:Play()

                mouse.Target.Parent.Torso.Velocity = (workspace.CurrentCamera.CoordinateFrame.lookVector*forceValue) + Vector3.new(0,70,0) 

            end

        end
      
    end

end





mouse.KeyDown:connect(ForcePush)

3 comments

0

Didn't you already ask this question?

0

Yes and noones answering?! SO CANT I ASK IT AGAIN?!

0

Actually, no, you can't. Duplicate questions is against the Community Guidelines.