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)
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)
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.