#character punch help

4 messages · Page 1 of 1 (latest)

coral musk
#

local player = game.Players.LocalPlayer

player.InputBegan:Connect(function(inputObject)
if inputObject.UserInputType == Enum.UserInputType.MouseButton1 then
-- Left mouse button clicked
local part = Instance.new("Part")
part.Parent = workspace
part.Position = player.Character.Head.Position + (player.Character.Head.CFrame.LookVector * 5)

    local bodyVelocity = Instance.new("BodyVelocity")
    bodyVelocity.Velocity = player.Character.Head.CFrame.LookVector * 50 
    bodyVelocity.Parent = part

    -- Make part disappear after 2 seconds
    debris:AddItem(part, 2)
end

end)

put this in a local script inside StartPlayerScripts. any reason why its not working?

sonic thicket
#

It could be because bodyvelocity is deprecated, and I’ve used debris before and it never really worked for me.

#

Use linear velocity instead.

#

Or assembly linear velocity