local player = script.Parent.Parent.Parent
local char = player.Character
local colors = {"Bright red","Bright orange","Bright yellow","Bright green","Bright blue","Bright violet","Institutional white","Medium stone grey","Dark stone grey","Really black"}
local color = 1
local speed = 60
local down = false
local jdeb = false
local cam = workspace.CurrentCamera
local sspeed = speed
local force
function UpdateColor() if char:findFirstChild("Marble") ~= nil then char.Marble.BrickColor = BrickColor.new(colors[color]) end end
function SetSpeed(v) char.Marble.BodyVelocity.velocity = v end
script.Parent.Selected:connect(function(mouse)
char.Humanoid.PlatformStand = true
local p = Instance.new("Part")
p.Name = "Marble"
p.Position = char.Torso.Position
p.Shape = 0
p.Transparency = 0.5
p.Size = Vector3.new(7,7,7)
p.BrickColor = BrickColor.new(colors[color])
p.TopSurface = "Smooth"
p.BottomSurface = "Smooth"
p.Parent = char
local w = Instance.new("Weld")
w.Parent = p
w.Part0 = p
w.Part1 = char.Torso
w.C0 = CFrame.new(Vector3.new(0,0,0))
local b = Instance.new("BodyVelocity")
b.velocity = Vector3.new(0,0,0)
b.maxForce = Vector3.new(3e+004, 3e+004, 3e+004)
b.Parent = p
force = b
cam.CameraSubject = char.Torso
cam.CameraType = "Track"
mouse.KeyDown:connect(function(key)
if key == "q" then if color > 1 then color = color-1 UpdateColor() end end
if key == "e" then if color < #colors then color = color+1 UpdateColor() end end
end)
mouse.KeyUp:connect(function(key) if key == "z" then speed = sspeed end end)
mouse.Button1Down:connect(function()
down = true
force.velocity = (mouse.Hit.p-char.Torso.Position).unit*speed
end)
mouse.Button1Up:connect(function() down = false
SetSpeed(Vector3.new(0,0,0)) -- This is where the script slows the ball down to 0 speed, I would like it to roll and gradualy slow down at this point.
-- It would be best if the ball rolled "freely", so if stopped on a ramp, it would roll down.
end)
mouse.Move:connect(function() if down then force.velocity = (mouse.Hit.p-char.Torso.Position).unit*speed end end)
end)
script.Parent.Deselected:connect(function() cam.CameraSubject = char.Humanoid cam.CameraType = "Custom" pcall(function() char.Marble:remove() char.Humanoid.PlatformStand = false end)end)
What I need included in this script is also noted next to the line, but here it is again:
SetSpeed(Vector3.new(0,0,0)) -- This is where the script slows the ball down to 0 speed, I would like it to roll and gradualy slow down at this point.
-- It would be best if the ball rolled "freely", so if stopped on a ramp, it would roll down.
The script is a LocalScript, inside a tool.

3 comments
Thanks for the -1, so appreciated :)
I think they're giving you -1 because you don't start out with an explanation of what you want; they're just seeing a huge script. Most of the script is irrelevant to your question (I essentially didn't read it, except for a few lines).
This is the ugliest code I have ever seen *facepalm