hello, i dont quite understand how bodypositions work.
can anybody explain why this isnt working?
wait(2)
for i, v in pairs(players:GetChildren()) do
local HumanoidRootPart = v:FindFirstChild("HumanoidRootPart")
local BP = Instance.new("BodyPosition",v)
BP.MaxForce = Vector3.new(25000,25000,25000)
BP.P = 100
BP.D = 100
BP.Position = Vector3.new(10,0,0)
end
wait(5)
print("exectued")
for i, v in pairs(players:GetChildren()) do
local HumanoidRootPart = v:FindFirstChild("HumanoidRootPart")
local BP = Instance.new("BodyPosition")
BP.Parent = HumanoidRootPart
BP.MaxForce = Vector3.new(25000,25000,25000)
BP.Position = Vector3.new(20,0,0)
BP.P = 100000
BP.D = 100
end``` i did this but it still doesnt work
wait(5)
print("exectued")
for i, v in pairs(players:GetChildren()) do
local HumanoidRootPart = v:FindFirstChild("HumanoidRootPart")
local BP = Instance.new("BodyPosition")
BP.Parent = HumanoidRootPart
BP.MaxForce = Vector3.new(25000,25000,25000)
BP.Position = Vector3.new(20,0,0)
BP.P = 1000000
BP.D = 1
end
this still doesnt work unfortunatelty!
Oops, you aren’t checking the Character for the HumanoidRootPart, you’re checking the player specifically. To fix this, do v.Character:FindFirstChild("HumanoidRootPart").