Script Is Not Working

server script:

local remote = game.ReplicatedStorage:WaitForChild("Hitted1")

remote.OnServerEvent:Connect(function(plr, target, mouseCFrame)
	if plr then
		if plr.Parent:FindFirstChild("Humanoid") then
			local lookVector = mouseCFrame.LookVector --Gets mouse CFrame

			if mouseCFrame.LookVector.Y < 0 then 
				lookVector = mouseCFrame.LookVector * Vector3.new(1,-1,1) --This is only to make player knockback upwards, and not downwards. You can remove this if you want.
			end

			local root = plr.Parent.HumanoidRootPart
			local velocity = Instance.new("BodyVelocity")

			local humanoid = plr.Character:WaitForChild("Humanoid")

			velocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
			velocity.P = 1500
			velocity.Velocity = lookVector * 5 * Vector3.new(5, 5, 5) --Get mouse direction and increases it, you can mess around with this values until you find a good one
			velocity.Parent = root
			wait(0.5)
			velocity:Destroy()
		end
	end
end)

this script above works yesterday now it’s not working and no errors
any help will work and post with the script

try printing something inside the if statements under remote.OnServerEvent thing and see if it prints?

Try replacing this:

if plr.Parent:FindFirstChild("Humanoid") then

with

if plr.Character:FindFirstChild("Humanoid") then

as well as all other times you called plr.Parent (replace them with plr.Character)

1 Like

This is working.

Is it just me, or this the OP create 4 duplicates of the exact same topic?