Force part issue

Player wouldnt be pushed back when they touch the part.

Code:

local CS = game:GetService("CollectionService")

local Storage = script.Parent

local Database = require(game:GetService("ServerStorage"):WaitForChild("Database"))

Storage.ChildAdded:Connect(function(Child)
	
	if Child:HasTag("ForceBall") then
		
		Child.Touched:Connect(function(hit)
			
			if hit.Parent:FindFirstChild("Humanoid") then
				
				local ForceStrength = Database[Child.Name].ForceMagnitude
				
				local ForceToExert = -hit.Parent.HumanoidRootPart.CFrame.LookVector * (ForceStrength * 20) + Vector3.new(0,20,0)
				
				hit.Parent.HumanoidRootPart.AssemblyLinearVelocity = -hit.Parent.HumanoidRootPart.CFrame.LookVector * (ForceStrength * 500)
				
				print("123")
				
			end
			
		end)
		
	end
	
end)

do it 2 times

local CS = game:GetService("CollectionService")

local Storage = script.Parent

local Database = require(game:GetService("ServerStorage"):WaitForChild("Database"))

Storage.ChildAdded:Connect(function(Child)

	if Child:HasTag("ForceBall") then

		Child.Touched:Connect(function(hit)

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

				local ForceStrength = Database[Child.Name].ForceMagnitude

				local ForceToExert = -hit.Parent.HumanoidRootPart.CFrame.LookVector * (ForceStrength * 20) + Vector3.new(0,20,0)

				hit.Parent.HumanoidRootPart.AssemblyLinearVelocity = -hit.Parent.HumanoidRootPart.CFrame.LookVector * (ForceStrength * 500)
				task.wait()
				hit.Parent.HumanoidRootPart.AssemblyLinearVelocity = -hit.Parent.HumanoidRootPart.CFrame.LookVector * (ForceStrength * 500)

				print("123")

			end

		end)

	end

end)

use a vectorforce on the player character HRP instead of assemblylinearvelocity

Whats better? VectorFroce or LinearVelocity and why not AssemblyLinearVelocity

AssemblyLinearVelocity works like a conveyor, vectorforce actually pushes things

How about LinearVelocity?

extra text…

LinearVelocity is depreciated for AssemblyLinearVelocity pretty sure

Wdym for AssemblyLinearVelocity does are 2 seperate things?

Is it being controlled on the server? If so, I think you have to use a client script because the player has its network owner to itself making the server unable to launch the root. Not sure if this is correct though.