#tool not adding bodyvelocity to the player

23 messages · Page 1 of 1 (latest)

lean comet
#
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local tool = script.Parent

tool.Equipped:Connect(function(mouse)
    mouse.Button1Down:Connect(function()
        local torso = mouse.Target.Parent:FindFirstChild("Torso")
        local root = mouse.Target.Parent:FindFirstChild("HumanoidRootPart")
        local myRoot = tool.Parent:FindFirstChild("HumanoidRootPart")
        if torso or root then
            print("Player")
            torso.Parent:FindFirstChild("Humanoid").Sit = true
            local bv = Instance.new("BodyVelocity")
            local delta = myRoot.CFrame.lookVector + Vector3.new(0, 1, 0)
            bv.maxForce = Vector3.new(1e10, 1e10, 1e10)
            bv.velocity = delta.unit * 150
            bv.Parent = torso    

            game:GetService("Debris"):AddItem(bv, 0.4)
            print("bodyvelocity")

        end
    end)


end)

for some reason when i target a player with my mouse it prints player and bodyvelocity but it doesnt do anything (it only applies bodyvelocity and sit to dummies but not on players)

lean comet
north reef
lean comet
north reef
#

keep the local script as it is

#

but make the server script handle the body velocity

#

and place the server script in server script service

lean comet
#

where do i place the remote?

lean comet
lean comet
north reef
#

do you know any scripting?

north reef
north reef
north reef
lean comet
lean comet
#

it worked

#

thanks

#

last question do you know how to reduce the distance between my mouse and the player? I can click it from afar and I don't want that

north reef