local ThisPart = script.Parent
ThisPart.Anchored = false
local Force = Instance.new("BodyPosition")
Force.Position = ThisPart.Position
Force.MaxForce = Vector3.new(3000,5000,3000)
Force.D = 1000
Force.Parent = ThisPart
local players = game:GetService("Players"):GetPlayers()
local pickedPlayer = players[math.random(1, #players)]
local alredytriggered = false
while wait() do
local PlrPosition = pickedPlayer.Character:FindFirstChild("HumanoidRootPart").Position
Distance = (ThisPart.Position - PlrPosition).Magnitude
if Distance < 20 or alredytriggered == true then
alredytriggered = true
Force.Position = PlrPosition
end
end
local ThisPart = script.Parent
local can = true
local players = game:GetService("Players"):GetPlayers()
local pickedPlayer = players[math.random(1, #players)]
while wait() do
local PlrPosition = pickedPlayer.Character.PrimaryPart.Position
Distance = (ThisPart.Position - PlrPosition).Magnitude
if Distance < 10 and can == true then
can = false
local TweenService = game:GetService("TweenService")
local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 0,false,0)
local tween = TweenService:Create(ThisPart, tweenInfo, {Position = Vector3.new(PlrPosition.X, PlrPosition.Y, PlrPosition.Z)})
tween:Play()
end
end
ThisPart.Anchored = true
wait(1)
local ThisPart = script.Parent
ThisPart.Anchored = false
local Force = Instance.new("BodyPosition")
Force.Position = ThisPart.Position
Force.MaxForce = Vector3.new(3000,5000,3000)
Force.D = 1000
Force.Parent = ThisPart
local players = game:GetService("Players"):GetPlayers()
local pickedPlayer = players[math.random(1, #players)]
local alredytriggered = false
while wait() do
local PlrPosition = pickedPlayer.Character:FindFirstChild("HumanoidRootPart").Position
Distance = (ThisPart.Position - PlrPosition).Magnitude
if Distance < 20 or alredytriggered == true then
alredytriggered = true
Force.Position = PlrPosition
end
end
ThisPart.Anchored = true
wait(1)
local ThisPart = script.Parent
ThisPart.Anchored = false
local Force = Instance.new("BodyPosition")
Force.Position = ThisPart.Position
Force.MaxForce = Vector3.new(3000,5000,3000)
Force.D = 1000
Force.Parent = ThisPart
Force.P = 20 --Change this to whatever the speed is?
local players = game:GetService("Players"):GetPlayers()
local pickedPlayer = players[math.random(1, #players)]
local alredytriggered = false
while wait() do
local PlrPosition = pickedPlayer.Character:FindFirstChild("HumanoidRootPart").Position
Distance = (ThisPart.Position - PlrPosition).Magnitude
if Distance < 20 or alredytriggered == true then
alredytriggered = true
Force.Position = PlrPosition
end
end
Referring back to this code, you could increase the force of the orb to make it go faster.
Never used BodyPosition before so whichever controls the speed.
Also yeah, a video would be cool if that’s necessary.
And to think, you were using TweenService! the code has been changed so much and I’m glad that BodyPosition worked good for you! It’s amazing that BodyPosition is Deprecated.