local plr = game.Players.LocalPlayer
local RollerStorage = workspace:WaitForChild("RollerStorage")
local Range = 30
local pushForce = 200
while true do
for _, Roller in pairs(RollerStorage:GetChildren()) do
if plr:DistanceFromCharacter(Roller.Position) <= Range then
local Char = plr.Character
if Char then
local direction = (Roller.Position - Char.HumanoidRootPart.Position).unit
local forceVector = direction * pushForce
local Attachment = Instance.new("Attachment")
Attachment.Parent = Roller
local VF = Instance.new("VectorForce")
VF.Parent = Roller
VF.Force = forceVector
task.wait(0.1)
VF:Destroy()
Attachment:Destroy()
end
end
end
task.wait()
end
If a player gets within the range the ball will be pushed away