Run it
Copy the script and paste it into your executor.
P = :()
UIS = :()
RS = :()
TS = :()
plr = P.LocalPlayer
cam = .CurrentCamera
ps = plr:()
pm = ps:()
ok, mod = (, pm)
ctl
ok mod mod.GetControls
(()
ctl = mod:()
)
mob = UIS.TouchEnabled UIS.KeyboardEnabled
on =
keys = {}
pos
yaw =
pit =
oldType
oldSub
oldCf
oldMouse
oldCtl =
spd =
spr =
ls =
ts =
lt
lp
rt
stm =
lastPos
ui = .()
ui.Name =
ui.ResetOnSpawn =
ui.IgnoreGuiInset =
ui.ZIndexBehavior = .ZIndexBehavior.Sibling
(()
ui.Parent = :()
)
ui.Parent
ui.Parent = plr:()
btn
stroke
hint
()
c = plr.Character
c c:()
()
v = cam.CFrame.LookVector
yaw = .(-v.X, -v.Z)
pit = .(.(v.Y, -, ))
(v)
btn
TS:(
btn,
TweenInfo.(, .EasingStyle.Quad, .EasingDirection.Out),
{
BackgroundColor3 = v
.(, , )
.(, , )
}
):()
TS:(
stroke,
TweenInfo.(, .EasingStyle.Quad, .EasingDirection.Out),
{
Color = v
.(, , )
.(, , )
}
):()
()
on
r = ()
r
cam = .CurrentCamera
oldType = cam.CameraType
oldSub = cam.CameraSubject
oldCf = cam.CFrame
oldMouse = UIS.MouseBehavior
pos = cam.CFrame.Position
()
ctl
oldCtl =
(()
ctl:()
)
cam.CameraType = .CameraType.Scriptable
mob
UIS.MouseBehavior = .MouseBehavior.LockCurrentPosition
on =
stm =
lastPos =
()
(()
plr:(pos, )
)
lastPos = pos
()
on
on =
lt =
rt =
lp =
cam = .CurrentCamera
cam.CameraType = oldType .CameraType.Custom
cam.CameraSubject = oldSub
oldCf
cam.CFrame = oldCf
UIS.MouseBehavior = oldMouse .MouseBehavior.Default
ctl oldCtl
(()
ctl:()
)
oldCtl =
pos =
lastPos =
()
()
on
()
()
mob
btn = .()
btn.Name =
btn.Size = .(, )
btn.Position = .(, -, , -)
btn.BackgroundColor3 = .(, , )
btn.BorderSizePixel =
btn.Active =
btn.ZIndex =
btn.Parent = ui
cr = .()
cr.CornerRadius = .(, )
cr.Parent = btn
stroke = .()
stroke.Thickness =
stroke.Color = .(, , )
stroke.Parent = btn
ic = .()
ic.Size = .(, )
ic.Position = .(, )
ic.AnchorPoint = .(, )
ic.BackgroundTransparency =
ic.Image =
ic.ImageColor3 = .(, , )
ic.ZIndex =
ic.Parent = btn
us = .()
us.Parent = btn
drag
start
moved =
btn.InputBegan:((i)
i.UserInputType ~= .UserInputType.Touch
i.UserInputType ~= .UserInputType.MouseButton1
drag = i.Position
start = btn.Position
moved =
)
btn.InputChanged:((i)
i.UserInputType ~= .UserInputType.Touch
i.UserInputType ~= .UserInputType.MouseMovement
c
c = UIS.InputChanged:((x)
x ~= i
drag start
c:()
d = x.Position - drag
d.Magnitude >
moved =
btn.Position = .(
start.X.Scale,
start.X.Offset + d.X,
start.Y.Scale,
start.Y.Offset + d.Y
)
)
)
btn.InputEnded:((i)
i.UserInputType ~= .UserInputType.Touch
i.UserInputType ~= .UserInputType.MouseButton1
moved
TS:(
us,
TweenInfo.(, .EasingStyle.Quad, .EasingDirection.Out),
{Scale = }
):()
.(, ()
us.Parent
TS:(
us,
TweenInfo.(, .EasingStyle.Quad, .EasingDirection.Out),
{Scale = }
):()
)
()
drag =
start =
moved =
)
hint = .()
hint.Name =
hint.AnchorPoint = .(, )
hint.Position = .(, -, , )
hint.Size = .(, )
hint.BackgroundTransparency =
hint.Text =
hint.TextSize =
hint.Font = .Font.GothamMedium
hint.TextXAlignment = .TextXAlignment.Right
hint.ZIndex =
hint.Parent = ui
UIS.InputBegan:((i, p)
mob
i.KeyCode == .KeyCode.F p
()
on i.UserInputType == .UserInputType.Keyboard
keys[i.KeyCode] =
on
i.UserInputType == .UserInputType.Touch
vp = cam.ViewportSize
x = i.Position.X
y = i.Position.Y
bx = btn.AbsolutePosition
bs = btn.AbsoluteSize
inBtn =
x >= bx.X
x <= bx.X + bs.X
y >= bx.Y
y <= bx.Y + bs.Y
inBtn
x < vp.X * y > vp.Y * lt
lt = i
lp = i.Position
x >= vp.X * rt
rt = i
)
UIS.InputEnded:((i)
i.UserInputType == .UserInputType.Keyboard
keys[i.KeyCode] =
i == lt
lt =
lp =
i == rt
rt =
)
UIS.InputChanged:((i)
on
mob
i.UserInputType == .UserInputType.MouseMovement
yaw -= i.Delta.X * ls
pit -= i.Delta.Y * ls
pit = .(pit, -.(), .())
i.UserInputType == .UserInputType.Touch
i == rt
yaw -= i.Delta.X * ts
pit -= i.Delta.Y * ts
pit = .(
pit,
-.(),
.()
)
)
rtick =
RS.RenderStepped:((dt)
hint
rtick += dt *
hint.TextColor3 = .(
rtick % ,
,
)
on
cam = .CurrentCamera
pos
pos = cam.CFrame.Position
cr = .(, yaw, ) * .(pit, , )
mv = .zero
mob
lt lp
d = lt.Position - lp
v = .(
.(d.X / , -, ),
.(d.Y / , -, )
)
mv += cr.RightVector * v.X
mv += cr.LookVector * -v.Y
f =
r =
u =
keys[.KeyCode.W]
f +=
keys[.KeyCode.S]
f -=
keys[.KeyCode.A]
r -=
keys[.KeyCode.D]
r +=
keys[.KeyCode.U]
u +=
keys[.KeyCode.D]
u -=
mv += cr.LookVector * f
mv += cr.RightVector * r
mv += .yAxis * u
mv.Magnitude >
mv = mv.Unit
speed = spd
keys[.KeyCode.LeftShift]
keys[.KeyCode.RightShift]
speed = spr
pos += mv * speed * dt
stm += dt
stm >=
stm =
lastPos (pos - lastPos).Magnitude >=
lastPos = pos
.(()
(()
plr:(pos, )
)
)
cf =
.(pos)
* .(, yaw, )
* .(pit, , )
cam.CFrame = cf
cam.Focus = .(pos)
)
plr.CharacterAdded:(()
on
()
)allows you to use freecam on mobile and pc pretty cool PC controls: wasd to move press "f" key to toggle freecam on and off, and press "u" key to go up while using freecam.

Universal