0% found this document useful (0 votes)
1 views6 pages

Code

The document is a Lua script designed for a game, specifically to create a visualizer GUI that responds to audio playback. It generates various visual effects using bars and dots based on the audio's loudness and rhythm, cycling through different modes such as 'VERTICAL_BARS' and 'SPIRAL'. The script also includes sound playback and GUI management, ensuring a dynamic and interactive experience for the player.

Uploaded by

buyyakrkhimthxng
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views6 pages

Code

The document is a Lua script designed for a game, specifically to create a visualizer GUI that responds to audio playback. It generates various visual effects using bars and dots based on the audio's loudness and rhythm, cycling through different modes such as 'VERTICAL_BARS' and 'SPIRAL'. The script also includes sound playback and GUI management, ensuring a dynamic and interactive experience for the player.

Uploaded by

buyyakrkhimthxng
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

local _0xA={

[1]={80,108,97,121,101,114,115},
[2]={83,111,117,110,100,83,101,114,118,105,99,101},
[3]={83,99,114,101,101,110,71,117,105},
[4]={84,101,120,116,76,97,98,101,108},
[5]={70,114,97,109,101}
}

local function _0xF(i)


local s=""
for _,b in pairs(_0xA[i]) do s=s..[Link](b) end
return s
end

local Players = game:GetService(_0xF(1))


local SoundService= game:GetService(_0xF(2))
local TweenService= game:GetService("TweenService")

local lp = [Link]
local pGui = lp:WaitForChild("PlayerGui")

if pGui:FindFirstChild("VIZ_GUI") then pGui.VIZ_GUI:Destroy() end

local _0xSD = [Link]("Sound")


_0xSD.Parent = SoundService
_0xSD.Volume = 1
_0xSD.SoundId = "rbxassetid://142376088"
_0xSD.Looped = true
pcall(function() _0xSD.Loaded:Wait() end)
_0xSD:Play()

local gui = [Link](_0xF(3), pGui)


[Link] = "VIZ_GUI"
[Link] = true
[Link] = false

local bg = [Link](_0xF(5), gui)


[Link] = [Link](1,0,1,0)
bg.BackgroundColor3 = [Link](0,0,0)
[Link] = 0
[Link] = 1

local BAR_COUNT = 48
local bars = {}
local barContainer = [Link](_0xF(5), gui)
[Link] = [Link](1,0,1,0)
[Link] = 1
[Link] = 0
[Link] = 5

for i = 1, BAR_COUNT do
local b = [Link](_0xF(5), barContainer)
[Link] = [Link](0.5, 0.5)
b.BackgroundColor3 = [Link](i/BAR_COUNT, 1, 1)
[Link] = 0
[Link] = 5
[Link]("UICorner", b).CornerRadius = [Link](0, 4)
bars[i] = b
end
local PART_COUNT = 80
local parts = {}
local partLayer = [Link](_0xF(5), gui)
[Link] = [Link](1,0,1,0)
[Link] = 1
[Link] = 0
[Link] = 3

for i = 1, PART_COUNT do
local p = [Link](_0xF(5), partLayer)
[Link] = [Link](0.5,0.5)
[Link] = 0
[Link] = 3
[Link]("UICorner", p).CornerRadius = [Link](1,0)
parts[i] = {
f = p,
px = [Link](),
py = [Link](),
vx = ([Link]()-0.5)*0.001,
vy = ([Link]()-0.5)*0.001,
h = [Link](),
}
end

local txt = [Link](_0xF(4), gui)


[Link] = [Link](0.55,0,0.13,0)
[Link] = [Link](0.5,0.5)
[Link] = [Link](0.5,0,0.5,0)
[Link] = "Tacos"
[Link] = true
[Link] = 1
[Link] = [Link]
txt.TextColor3 = [Link](1,1,1)
[Link] = 10

local stroke = [Link]("UIStroke", txt)


[Link] = 2
[Link] = [Link](0,255,200)

local MODES = {
"VERTICAL_BARS",
"MIRROR_BARS",
"RADIAL_RING",
"HORIZONTAL_WAVE",
"SCATTER_DOTS",
"TUNNEL_RINGS",
"DIAGONAL_BARS",
"SPIRAL",
}

local currentMode = MODES[1]


local modeTimer = 0
local MODE_INTERVAL = 1

local smoothLv = 0
local hue = 0
local beatFlash = 0
local lastBeat = 0
local bgHue = 0

local function setBarVisible(v)


for i=1,BAR_COUNT do bars[i].Visible = v end
end

local function setPartVisible(v)


for i=1,PART_COUNT do parts[i].[Link] = v end
end

local function applyMode(mode, t, lv, h)


local W, H = 1, 1

if mode == "VERTICAL_BARS" then


setBarVisible(true)
setPartVisible(false)
local bw = [Link](950/BAR_COUNT)
for i=1,BAR_COUNT do
local fi = i/BAR_COUNT
local wave = [Link](t*4 + fi*[Link]*3)*0.35 + [Link](t*2.5 +
fi*[Link]*1.5)*0.25
local ht = [Link]((lv*0.6 + wave*0.4 + beatFlash*0.2)*0.85, 0.02,
0.85)
bars[i].Size = [Link](0,bw, ht,0)
bars[i].Position = [Link](fi,0, 1,-0)
bars[i].AnchorPoint = [Link](0.5,1)
bars[i].BackgroundColor3 = [Link]((h+fi*0.4)%1,1,1)
bars[i].BackgroundTransparency = 0.1
end

elseif mode == "MIRROR_BARS" then


setBarVisible(true)
setPartVisible(false)
local bw = [Link](950/BAR_COUNT)
for i=1,BAR_COUNT do
local fi = i/BAR_COUNT
local wave = [Link](t*5 + fi*[Link]*2)*0.4 + [Link](t*3 +
fi*[Link])*0.3
local ht = [Link]((lv*0.55 + wave*0.45 + beatFlash*0.15)*0.42,
0.01, 0.42)
bars[i].Size = [Link](0,bw, ht,0)
bars[i].Position = [Link](fi,0, 0.5,0)
bars[i].AnchorPoint = [Link](0.5,0.5)
local bh = (h + fi*0.5)%1
bars[i].BackgroundColor3 = [Link](bh,1,1)
bars[i].BackgroundTransparency = 0.05
end

elseif mode == "RADIAL_RING" then


setBarVisible(true)
setPartVisible(false)
local cx, cy = 0.5, 0.5
local baseR = 0.18 + lv*0.1
for i=1,BAR_COUNT do
local fi = i/BAR_COUNT
local angle = fi*[Link]*2 + t*0.8
local wave = [Link](t*6 + fi*[Link]*4)*0.5+0.5
local r = baseR + (lv*0.12 + wave*0.08 + beatFlash*0.05)
local barH = [Link](lv*0.12 + wave*0.06 + 0.02, 0.02, 0.16)
bars[i].Size = [Link](0,6, barH,0)
bars[i].Position = [Link](cx + [Link](angle)*r, 0, cy +
[Link](angle)*r*1.6, 0)
bars[i].AnchorPoint = [Link](0.5,0.5)
bars[i].Rotation = [Link](angle) + 90
bars[i].BackgroundColor3 = [Link]((h+fi*0.6)%1,1,1)
bars[i].BackgroundTransparency = 0.1
end

elseif mode == "HORIZONTAL_WAVE" then


setBarVisible(true)
setPartVisible(false)
local bh_px = 10
for i=1,BAR_COUNT do
local fi = i/BAR_COUNT
local wave = [Link](t*3 + fi*[Link]*3)*0.3 + [Link](t*5.5 +
fi*[Link]*5)*0.2
local yPos = 0.5 + wave*(0.25 + lv*0.2)
local bw = [Link](0.015 + lv*0.008, 0.01, 0.025)
bars[i].Size = [Link](bw,0, 0, 8 + lv*20 + beatFlash*15)
bars[i].Position = [Link](fi, 0, yPos, 0)
bars[i].AnchorPoint = [Link](0.5,0.5)
bars[i].Rotation = 0
bars[i].BackgroundColor3 = [Link]((h+fi*0.35+wave*0.2)%1,1,1)
bars[i].BackgroundTransparency = 0.15
end

elseif mode == "SCATTER_DOTS" then


setBarVisible(false)
setPartVisible(true)
for i,pd in ipairs(parts) do
local fi = i/PART_COUNT
local angle = t*1.2 + fi*[Link]*2
local r = 0.05 + lv*0.35 + [Link](t*3+fi*5)*0.08
[Link] = 0.5 + [Link](angle)*r
[Link] = 0.5 + [Link](angle)*r*1.5
local ps = 4 + lv*18 + beatFlash*12
[Link] = [Link](0,ps,0,ps)
[Link] = [Link]([Link],0,[Link],0)
pd.f.BackgroundColor3 = [Link]((h+fi*0.7+t*0.1)%1,1,1)
[Link] = 0.1 + (1-lv)*0.5
[Link] = true
end

elseif mode == "TUNNEL_RINGS" then


setBarVisible(true)
setPartVisible(false)
local rings = 6
local barsPerRing = [Link](BAR_COUNT/rings)
for ring=1,rings do
local rFrac = ring/rings
local scale = rFrac + lv*(1-rFrac)*0.5 + [Link](t*2+ring)*0.05
scale = [Link](scale, 0.05, 0.95)
for j=1,barsPerRing do
local idx = (ring-1)*barsPerRing + j
if idx > BAR_COUNT then break end
local fi = j/barsPerRing
local angle = fi*[Link]*2 + t*(ring%2==0 and 0.5 or -0.5)
bars[idx].Size = [Link](0,5,0, 8+lv*20)
bars[idx].Position = [Link](0.5+[Link](angle)*scale*0.45,0,
0.5+[Link](angle)*scale*0.45,0)
bars[idx].AnchorPoint = [Link](0.5,0.5)
bars[idx].Rotation = [Link](angle)
bars[idx].BackgroundColor3 =
[Link]((h+rFrac*0.5+fi*0.2)%1,1,1)
bars[idx].BackgroundTransparency = 0.05 + (1-rFrac)*0.4
bars[idx].Visible = true
end
end

elseif mode == "DIAGONAL_BARS" then


setBarVisible(true)
setPartVisible(false)
local bw = [Link](900/BAR_COUNT)
for i=1,BAR_COUNT do
local fi = i/BAR_COUNT
local wave = [Link](t*4.5 + fi*[Link]*2.5)*0.4 + [Link](t*2 +
fi*[Link])*0.3
local ht = [Link]((lv*0.5 + wave*0.4 + beatFlash*0.2)*0.7, 0.02,
0.7)
bars[i].Size = [Link](0,bw, ht,0)
bars[i].Position = [Link](fi,0, 0.5+fi*0.3,0)
bars[i].AnchorPoint = [Link](0.5,1)
bars[i].Rotation = -20
bars[i].BackgroundColor3 = [Link]((h+fi*0.45)%1,1,1)
bars[i].BackgroundTransparency = 0.1
end

elseif mode == "SPIRAL" then


setBarVisible(true)
setPartVisible(false)
for i=1,BAR_COUNT do
local fi = i/BAR_COUNT
local angle = fi*[Link]*6 + t*1.5
local r = fi*0.4 + lv*0.08 + [Link](t*4+fi*3)*0.04
bars[i].Size = [Link](0,7, 0, 6+lv*16+beatFlash*10)
bars[i].Position = [Link](0.5+[Link](angle)*r,0,
0.5+[Link](angle)*r*1.5,0)
bars[i].AnchorPoint = [Link](0.5,0.5)
bars[i].Rotation = [Link](angle)+90
bars[i].BackgroundColor3 = [Link]((h+fi*0.8+t*0.05)%1,1,1)
bars[i].BackgroundTransparency = fi*0.4
end
end
end

local modeIndex = 1

[Link](function()
while true do
local t = tick()
local raw = _0xSD.PlaybackLoudness
if raw == 0 then raw = [Link]([Link](t*8))*200 end
local rawLv = [Link](raw/300, 0, 1)

smoothLv = smoothLv + (rawLv - smoothLv)*0.12


hue = (hue + 0.004)%1
bgHue = (bgHue + 0.002)%1
local isBeat = rawLv > 0.65 and (t - lastBeat) > 0.25
if isBeat then beatFlash = 1; lastBeat = t end
beatFlash = beatFlash * 0.82

modeTimer = modeTimer + 0.033


if modeTimer >= MODE_INTERVAL then
modeTimer = 0
modeIndex = (modeIndex % #MODES) + 1
currentMode = MODES[modeIndex]
for i=1,BAR_COUNT do bars[i].Rotation = 0 end
end

bg.BackgroundColor3 = [Link](bgHue, 0.7, 0.05 + smoothLv*0.1 +


beatFlash*0.12)

applyMode(currentMode, t, smoothLv, hue)

local ts = 1 + smoothLv*0.08 + beatFlash*0.1


[Link] = [Link](0.55*ts, 0, 0.13*ts, 0)
txt.TextColor3 = [Link](hue, 0.15, 1)
[Link] = [Link]((hue+0.4)%1, 1, 1)
[Link] = 1.5 + smoothLv*3 + beatFlash*4

[Link](0.033)
end
end)

You might also like