e.e. This works perfectly in studios however it isnt working in game. Can anyone help me figure out the problem because I got none.
--DONT TAKE THIS I WILL KILL YOU
--Credit to Angels_Develop for this Roll Ball
--if this is not currently in starterpack then please place it in it.
local plr = game.Players.LocalPlayer
local cam = game.Workspace.CurrentCamera
local UserInput = game:GetService('UserInputService')
local ContextActionService = game:GetService('ContextActionService')
local maxed = 100
repeat wait() until plr.Character and plr.Character.Humanoid
plr.Character:Destroy()
--Ball Stuff down here v
local ball = Instance.new("Part", workspace)
ball.Name = "Ball " .. plr.Name
ball.Transparency = 0.5
ball.Material = Enum.Material.Metal
ball.BrickColor = BrickColor.Random()
ball.Shape = Enum.PartType.Ball
ball.Size = Vector3.new(2,2,2)
ball.BackSurface = Enum.SurfaceType.SmoothNoOutlines
ball.TopSurface = Enum.SurfaceType.SmoothNoOutlines
ball.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
ball.RightSurface = Enum.SurfaceType.SmoothNoOutlines
ball.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
ball.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
ball.Position = Vector3.new(0, 20, 0)
--Ball Stuff up here ^
-- Camera Stuff here v
cam.CameraSubject = ball
cam.CameraType = Enum.CameraType.Custom
--Camera Stuff here ^
-- Some where down here it stops working V :p
--BodyPosition Here
local dim = true
local pos = Instance.new("BodyVelocity", ball)
--BodyPositon here
--Main Script v
-- Fowards
local Foward = function(actionName, actionInputState, actionInputObject)
print(actionInputState)
if actionInputObject.UserInputType == Enum.UserInputType.Keyboard then
if actionInputState == Enum.UserInputState.Begin
and pos.Velocity.X>-maxed then
repeat pos.Velocity = pos.Velocity - Vector3.new(2,0,0) wait(0.1)
until pos.Velocity.X<=-maxed
or actionInputState == Enum.UserInputState.End
elseif (actionInputState == Enum.UserInputState.End
or actionInputState == Enum.UserInputState.None )
and pos.Velocity.X<0 then
repeat pos.Velocity = pos.Velocity + Vector3.new(2,0,0) wait(0.1)
until pos.Velocity.X>=0
or actionInputState == Enum.UserInputState.Begin
end
end
end
ContextActionService:BindAction('Move Forward', Foward ,true, Enum.KeyCode.W)
--Fowards
--Backwards
local Backwards = function(actionName, actionInputState, actionInputObject)
print(actionInputState)
if actionInputObject.UserInputType == Enum.UserInputType.Keyboard then
if actionInputState == Enum.UserInputState.Begin
and pos.Velocity.X<maxed then
repeat pos.Velocity = pos.Velocity + Vector3.new(2,0,0) wait(0.1)
until pos.Velocity.X>=maxed
or actionInputState == Enum.UserInputState.End
elseif (actionInputState == Enum.UserInputState.End
or actionInputState == Enum.UserInputState.None ) and pos.Velocity.X>0 then
repeat pos.Velocity = pos.Velocity - Vector3.new(2,0,0) wait(0.1)
until pos.Velocity.X<=0
or actionInputState == Enum.UserInputState.Begin
end
end
end
ContextActionService:BindAction('Move Backwards', Backwards ,true, Enum.KeyCode.S)
--Backwards
--Left
local Left = function(actionName, actionInputState, actionInputObject)
print(actionInputState)
if actionInputObject.UserInputType == Enum.UserInputType.Keyboard then
if actionInputState == Enum.UserInputState.Begin
and pos.Velocity.Z<maxed then
repeat pos.Velocity = pos.Velocity + Vector3.new(0,0,2) wait(0.1)
until pos.Velocity.Z>=maxed
or actionInputState == Enum.UserInputState.End
elseif (actionInputState == Enum.UserInputState.End
or actionInputState == Enum.UserInputState.None ) and pos.Velocity.Z>0 then
repeat pos.Velocity = pos.Velocity - Vector3.new(0,0,2) wait(0.1)
until pos.Velocity.Z<=0
or actionInputState == Enum.UserInputState.Begin
end
end
end
ContextActionService:BindAction('Move Left', Left ,true, Enum.KeyCode.A)
-- Left
--Right
local Right = function(actionName, actionInputState, actionInputObject)
if actionInputObject.UserInputType == Enum.UserInputType.Keyboard then
if actionInputState == Enum.UserInputState.Begin
and pos.Velocity.Z>-maxed then
repeat pos.Velocity = pos.Velocity - Vector3.new(0,0,2) wait(0.1)
until pos.Velocity.Z<=-maxed
or actionInputState == Enum.UserInputState.End
elseif (actionInputState == Enum.UserInputState.End
or actionInputState == Enum.UserInputState.None )
and pos.Velocity.Z<0 then
repeat pos.Velocity = pos.Velocity + Vector3.new(0,0,2) wait(0.1)
until pos.Velocity.Z>=0
or actionInputState == Enum.UserInputState.Begin
end
end
end
ContextActionService:BindAction('Move Right', Right ,true, Enum.KeyCode.D)
--Right
--Main Script ^
--Credit to Angels_Develop for going through her own spare time to make this for people
--Bless Her

3 comments
e.e. I bet I wont get an answer because it is too complex for yall fellas out there
It's not that complex it's just a big script which is usually not seen here...
your not addressing my problem ..