Run it
Copy the script and paste it into your executor.
Players = :()
RunService = :()
UserInputService = :()
player = Players.LocalPlayer
guiParent = player:()
screenGui = .()
screenGui.Name =
screenGui.ResetOnSpawn =
screenGui.Parent = guiParent
mainFrame = .()
mainFrame.Size = .(, , , )
mainFrame.Position = .(, -, , -)
mainFrame.BackgroundColor3 = .(,,)
mainFrame.BorderSizePixel =
mainFrame.Parent = screenGui
scoreLabel = .()
scoreLabel.Size = .(,,,)
scoreLabel.Position = .(,,,-)
scoreLabel.BackgroundTransparency =
scoreLabel.Text =
scoreLabel.Font = .Font.SourceSansBold
scoreLabel.TextSize =
scoreLabel.TextColor3 = .(,,)
scoreLabel.Parent = mainFrame
map = {
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
,
}
rows = #map
cols = #map[]
CELL =
dirs = {Up={dr=-,dc=}, Down={dr=,dc=}, Left={dr=,dc=-}, Right={dr=,dc=}}
pellets = {}
pelletFrames = {}
pelletCount =
playerPos = {r=,c=}
ghostPositions = {}
r=,rows
c=,cols
cell = map[r]:(c,c)
x = (c-)*CELL
y = (r-)*CELL
cell==
wall = .()
wall.Size = .(,CELL,,CELL)
wall.Position = .(,x,,y)
wall.BackgroundColor3 = .(,,)
wall.BorderSizePixel =
wall.Parent = mainFrame
cell==
pellets[r....c] =
pelletCount +=
dot = .()
dot.Size = .(,,,)
dot.Position = .(,x+(CELL/-),,y+(CELL/-))
dot.BackgroundColor3 = .(,,)
dot.BorderSizePixel =
dot.Parent = mainFrame
pelletFrames[r....c] = dot
cell==
playerPos={r=r,c=c}
playerPos.r== playerPos={r=,c=}
openCells = {}
r=,rows
c=,cols
map[r]:(c,c)==
.(openCells,{r=r,c=c})
i=,
#openCells==
index = .(,#openCells)
.(ghostPositions,openCells[index])
.(openCells,index)
pac = .()
pac.Size = .(,CELL-,,CELL-)
pac.BackgroundColor3 = .(,,)
pac.Position = .(,(playerPos.c-)*CELL+,,(playerPos.r-)*CELL+)
pac.Parent = mainFrame
ghosts = {}
ghostColors = {.(,,),.(,,),.(,,),.(,,)}
i=,#ghostPositions
ghost = .()
ghost.Size = .(,CELL-,,CELL-)
ghost.BackgroundColor3 = ghostColors[i] .(,,)
ghost.Position = .(,(ghostPositions[i].c-)*CELL+,,(ghostPositions[i].r-)*CELL+)
ghost.Parent = mainFrame
.(ghosts,{gui=ghost,pos={r=ghostPositions[i].r,c=ghostPositions[i].c},dir={dr=,dc=}})
blockedPellets = {
, ,
}
running =
gameEnded =
score =
currentDir =
renderConn, inputConn
mobileConns = {}
(r,c)
r>= r<=rows c>= c<=cols map[r]:(c,c)~=
(r,c)
playerPos={r=r,c=c}
pac.Position = .(,(c-)*CELL+,,(r-)*CELL+)
key=r....c
pellets[key]
pellets[key]=
score +=
scoreLabel.Text = ..score
pelletFrames[key] pelletFrames[key]:()
pelletCount -=
(g)
possible = {}
_,d (dirs)
nr,nc=g.pos.r+d.dr,g.pos.c+d.dc
(nr,nc) (g.dir.dr==-d.dr g.dir.dc==-d.dc)
.(possible,d)
#possible==
_,d (dirs)
nr,nc=g.pos.r+d.dr,g.pos.c+d.dc
(nr,nc) .(possible,d)
#possible>
.(possible,(a,b)
da = .((g.pos.r+a.dr)-playerPos.r) + .((g.pos.c+a.dc)-playerPos.c)
db = .((g.pos.r+b.dr)-playerPos.r) + .((g.pos.c+b.dc)-playerPos.c)
da<db
)
g.dir = possible[]
()
running=
gameEnded=
renderConn renderConn:()
inputConn inputConn:()
_,c (mobileConns) c:()
screenGui screenGui:()
(msg)
overlay = .()
overlay.Size = .(,,,)
overlay.BackgroundColor3 = .(,,)
overlay.BackgroundTransparency =
overlay.Parent = screenGui
text = .()
text.Size = .(,,,)
text.Position = .(,,,)
text.BackgroundTransparency =
text.Text = msg
text.Font = .Font.SourceSansBold
text.TextSize =
text.TextColor3 = .(,,)
text.Parent = overlay
restart = .()
restart.Size = .(,,,)
restart.Position = .(,,,)
restart.BackgroundColor3 = .(,,)
restart.Text =
restart.TextColor3 = .(,,)
restart.Font = .Font.SourceSansBold
restart.TextSize =
restart.Parent = overlay
restart.MouseButton1Click:(cleanup)
mobileFrame = .()
mobileFrame.Size = .(,,,)
mobileFrame.Position = .(,-,,-)
mobileFrame.BackgroundTransparency =
mobileFrame.Parent = screenGui
(sym,x,y)
b = .()
b.Size = .(,,,)
b.Position = .(,x,,y)
b.BackgroundColor3 = .(,,)
b.Text = sym
b.Font = .Font.SourceSansBold
b.TextSize =
b.TextColor3 = .(,,)
b.Parent = mobileFrame
b
mobileConns = {
(,,).MouseButton1Down:(() currentDir = dirs.Up ),
(,,).MouseButton1Down:(() currentDir = dirs.Left ),
(,,).MouseButton1Down:(() currentDir = dirs.Right ),
(,,).MouseButton1Down:(() currentDir = dirs.Down ),
}
inputConn = UserInputService.InputBegan:((input,gp)
gp gameEnded
k=input.KeyCode.Name
dirs[k] currentDir = dirs[k]
)
ghostTimer,playerTimer=,
renderConn = RunService.RenderStepped:((dt)
running
playerTimer+=dt
ghostTimer+=dt
playerTimer> currentDir
nr,nc=playerPos.r+currentDir.dr,playerPos.c+currentDir.dc
(nr,nc) (nr,nc)
playerTimer=
ghostTimer>
_,g (ghosts)
(g)
nr,nc=g.pos.r+g.dir.dr,g.pos.c+g.dir.dc
(nr,nc)
g.pos={r=nr,c=nc}
g.gui.Position=.(,(nc-)*CELL+,,(nr-)*CELL+)
ghostTimer=
_,g (ghosts)
g.pos.r==playerPos.r g.pos.c==playerPos.c gameEnded
gameEnded=
running=
(..score)
remainingPellets =
k,v (pellets)
blocked =
_,b (blockedPellets)
k==b blocked=
blocked remainingPellets +=
remainingPellets<= gameEnded
gameEnded=
running=
(..score)
)
The first Game made with only scripts this is for games where you have to have patience and it's something to do

Universal