Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = owner
- repeat wait() until plr.Character
- local char = plr.Character
- local tors = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") or char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Head")
- script.Name = "KrY's Vis Main V2"
- --script.Parent = plr
- local folder = Instance.new("Folder")
- folder.Name = "KrY's Vis Folder"
- folder.Parent = script
- local remote = Instance.new("RemoteEvent")
- remote.Name = "KrY's Vis Remote V2"
- remote.Parent = plr['PlayerGui']
- local cube = Instance.new("Part")
- cube.Size = Vector3.new(3,3,3)
- cube.Anchored = true
- cube.CanCollide = false
- cube.Material = Enum.Material.Neon
- local cube2 = cube:Clone()
- local cube3 = cube:Clone()
- local cube4 = cube:Clone()
- local cube5 = cube:Clone()
- cube.Parent = folder
- cube2.Parent = folder
- cube3.Parent = folder
- cube4.Parent = folder
- cube5.Name = 'vis cube'
- cube5.Transparency = 1
- cube5.Size = Vector3.new()
- cube5.Parent = folder
- for i,v in pairs(folder:GetChildren()) do
- if v:IsA("BasePart") and v:CanSetNetworkOwnership() then
- v:SetNetworkOwner(plr)
- end
- end
- local cubeval = Instance.new("ObjectValue")
- cubeval.Name = 'cubeval'
- cubeval.Value = cube5
- cubeval.Parent = remote
- local song = Instance.new("Sound")
- song.Name = "KrY's Vis V2"
- song.Volume = 1
- song.Looped = true
- song.Parent = cube5
- sizing = false
- sizing2 = false
- sizing3 = false
- sizing4 = false
- getting = false
- bassing = {}
- songidthing = 0
- volume = 1
- speed = 1
- looped = true
- can_reload = true
- last_time = 0
- originalrad = 0
- originalspot = 0
- loudness = 0
- speedness = 0
- mode = 5
- prefix = "/"
- origin_size = Vector3.new(3,3,3)
- max_size = Vector3.new(4.5,4.5,4.5)
- coroutine.resume(coroutine.create(function()
- while true do
- pcall(function()
- if not song or not song.Parent and can_reload then
- song = Instance.new("Sound")
- song.Name = "KrY's Vis V2"
- song.SoundId = "rbxassetid://" .. songidthing
- song.Volume = volume
- song.Looped = looped
- song.PlaybackSpeed = speed
- song.TimePosition = last_time
- song.Parent = cube5
- song:Play()
- end
- if song and song.Parent then
- song.Name = "KrY's Vis V2"
- song.Volume = volume
- song.Looped = looped
- song.PlaybackSpeed = speed
- last_time = song.TimePosition
- song:Resume()
- end
- end)
- game:GetService("RunService").Heartbeat:Wait(1/30)
- end
- coroutine.yield()
- end))
- remote.OnServerEvent:Connect(function(plr,loud,speed)
- loudness = loud
- speedness = speed
- end)
- codestuffs = [[
- local remote = script.Parent
- local cube = remote['cubeval'].Value
- local song = cube:WaitForChild("KrY's Vis V2")
- cube.ChildRemoved:Connect(function(obj)
- if obj == song then
- song = cube:WaitForChild("KrY's Vis V2")
- end
- end)
- game:GetService("RunService").RenderStepped:Connect(function()
- if song and song.Parent then
- wait(.1)
- remote:FireServer(song.PlaybackLoudness, song.PlaybackSpeed)
- end
- end)
- ]]
- NLS(codestuffs, remote)
- local resize = function(part)
- local division_size = loudness/500
- local make_size = origin_size+Vector3.new(division_size,division_size,division_size)
- if make_size.Y > max_size.Y then
- make_size = max_size
- end
- game:GetService("TweenService"):Create(part,TweenInfo.new(0.1),{Size = make_size}):Play()
- end
- mrd1 = math.random(300,400)
- mrd2 = math.random(600,700)
- mrd3 = math.random(400,600)
- function other(p)
- game:GetService("TweenService"):Create(p,TweenInfo.new(0.5),{Color = Color3.new(loudness / mrd1,loudness / mrd2,loudness / mrd3)}):Play()
- end
- function add_bass_shadow(part)
- if not bassing[part] then else return end
- bassing[part] = true
- local shadow = part:Clone()
- shadow.Transparency = 0.6
- shadow.Material = Enum.Material.ForceField
- shadow.Size = shadow.Size*1.6
- local sphere = Instance.new("SpecialMesh")
- sphere.MeshType = Enum.MeshType.Sphere
- sphere.Parent = shadow
- local emit = Instance.new("ParticleEmitter")
- emit.Rotation = NumberRange.new(0, 360)
- emit.Color = ColorSequence.new(Color3.new(1, 0.878431, 0.431373),part.Color)
- emit.LightEmission = 0.6
- emit.Texture = "rbxassetid://203216563"
- emit.Transparency = NumberSequence.new(0.5,0.75,1)
- emit.Size = NumberSequence.new(0.3125,0.5625,0.60509598255157,0.5,0.3821650147438)
- emit.Lifetime = NumberRange.new(0.5, 0.75)
- emit.Rate = 25
- emit.RotSpeed = NumberRange.new(-500, 500)
- emit.SpreadAngle = Vector2.new(360, 360)
- emit.Speed = NumberRange.new(2, 3)
- emit.Rotation = NumberRange.new(0, 360)
- emit.LockedToPart = true
- emit.Parent = shadow
- shadow.Parent = part.Parent
- coroutine.resume(coroutine.create(function()
- emit.Enabled = true
- wait(0.1)
- emit.Enabled = false
- bassing[part] = false
- coroutine.yield()
- end))
- game:GetService("TweenService"):Create(shadow,TweenInfo.new(0.2),{Size = shadow.Size*2.1,Transparency = 1}):Play()
- game:GetService("Debris"):AddItem(shadow,2)
- end
- function repos(p,t,s1,s2,s3)
- originalrad = originalrad + ((speedness / 100) * (loudness / 100))
- local division_size = loudness/300
- local pos_size = Vector3.new(division_size,division_size,division_size)
- local make_size = origin_size+Vector3.new(division_size,division_size,division_size)
- local bass = false
- if pos_size.Y > max_size.Y then
- pos_size = max_size
- end
- if make_size.Y > max_size.Y then
- bass = true
- make_size = max_size
- end
- local _s1,_s2,_s3 = s1,s2,s3
- if s1 > 0 then
- _s1 = _s1 + pos_size.Y
- elseif 0 > s1 then
- _s1 = _s1 - pos_size.Y
- end
- if s2 > 0 then
- _s2 = _s2 + pos_size.Y
- elseif 0 > s2 then
- _s2 = _s2 - pos_size.Y
- end
- if s3 > 0 then
- _s3 = _s3 + pos_size.Y
- elseif 0 > s3 then
- _s3 = _s3 - pos_size.Y
- end
- if t then
- p.CFrame = t.CFrame + Vector3.new(_s1,_s2,_s3)
- end
- if bass and p ~= cube5 then
- add_bass_shadow(p)
- end
- if mode == 1 then
- p.CFrame = p.CFrame*CFrame.Angles(originalrad,0,originalrad)
- elseif mode == 2 then
- p.CFrame = p.CFrame*CFrame.Angles(originalrad,originalrad,originalrad)
- elseif mode == 3 then
- p.CFrame = p.CFrame*CFrame.Angles(originalrad,originalrad,0)
- elseif mode == 4 then
- p.CFrame = p.CFrame*CFrame.Angles(0,originalrad,originalrad)
- elseif mode == 5 then
- p.CFrame = p.CFrame*CFrame.Angles(0,originalrad,0)
- elseif mode == 6 then
- p.CFrame = p.CFrame*CFrame.Angles(0,0,originalrad)
- elseif mode == 6 then
- p.CFrame = p.CFrame*CFrame.Angles(originalrad,0,0)
- end
- p.CFrame = p.CFrame*CFrame.new(0,.75,0)
- end
- function downsize(parts)
- for _,part in pairs(parts) do
- part.Size = origin_size
- part.CFrame = part.CFrame*CFrame.Angles(0,0,0)
- end
- end
- function get()
- spawn(function()
- if not getting then else return end
- getting = true
- repeat wait() until plr.Character
- char = plr.Character
- tors = char:FindFirstChild("Torso") or char:FindFirstChild("UpperTorso") or char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Head")
- getting = false
- end)
- end
- coroutine.resume(coroutine.create(function()
- while true do
- get()
- if song.IsPlaying then
- resize(cube)
- other(cube)
- resize(cube2)
- other(cube2)
- resize(cube3)
- other(cube3)
- resize(cube4)
- other(cube4)
- elseif not song.IsPlaying then
- downsize({cube,cube2,cube3,cube4})
- end
- repos(cube,tors,5,0,0)
- repos(cube2,tors,0,0,-5)
- repos(cube3,tors,-5,0,0)
- repos(cube4,tors,0,0,5)
- repos(cube5,tors,0,0,0)
- game:GetService("RunService").Heartbeat:Wait(1/30)
- end
- coroutine.yield()
- end))
- plr.Chatted:Connect(function(msg)
- --
- if msg:lower():sub(1,4) == "vol" ..prefix then
- local choice = msg:sub(5)
- if tonumber(choice) then
- volume = choice
- song.Volume = choice
- end
- end
- --
- if msg:lower():sub(1,7) == "/e vol" ..prefix then
- local choice = msg:sub(8)
- if tonumber(choice) then
- volume = choice
- song.Volume = choice
- end
- end
- --
- if msg:lower():sub(1,5) == "loop" ..prefix then
- local choice = msg:sub(6)
- if choice == "false" then
- looped = false
- song.Looped = false
- elseif choice == "true" then
- looped = true
- song.Looped = true
- end
- end
- --
- if msg:lower():sub(1,8) == "/e loop" ..prefix then
- local choice = msg:sub(9)
- if choice == "false" then
- looped = false
- song.Looped = false
- elseif choice == "true" then
- looped = true
- song.Looped = true
- end
- end
- --
- if msg:lower():sub(1,5) == "pass" ..prefix then
- local choice = msg:sub(6)
- if choice == "false" then
- can_reload = false
- elseif choice == "true" then
- can_reload = true
- end
- end
- --
- if msg:lower():sub(1,8) == "/e pass" ..prefix then
- local choice = msg:sub(9)
- if choice == "false" then
- can_reload = false
- elseif choice == "true" then
- can_reload = true
- end
- end
- --
- if msg:lower():sub(1,5) == "play" ..prefix then
- songidthing = msg:sub(6)
- if tonumber(songidthing) then
- last_time = 0
- song.TimePosition = 0
- song.SoundId = 'rbxassetid://' .. songidthing
- --song:Destroy()
- end
- end
- --
- if msg:lower():sub(1,8) == "/e play" ..prefix then
- songidthing = msg:sub(9)
- if tonumber(songidthing) then
- last_time = 0
- song.TimePosition = 0
- song.SoundId = 'rbxassetid://' .. songidthing
- --song:Destroy()
- end
- end
- --
- if msg:lower():sub(1,5) == "stop" ..prefix then
- song:Stop()
- end
- --
- if msg:lower():sub(1,8) == "/e stop" ..prefix then
- song:Stop()
- end
- --
- if msg:lower():sub(1,6) == "pause" ..prefix then
- song:Pause()
- end
- --
- if msg:lower():sub(1,9) == "/e pause" ..prefix then
- song:Pause()
- end
- --
- if msg:lower():sub(1,7) == "resume" ..prefix then
- song:Resume()
- end
- --
- if msg:lower():sub(1,10) == "/e resume" ..prefix then
- song:Resume()
- end
- --
- if msg:lower():sub(1,6) == "speed" ..prefix then
- local choice = msg:lower():sub(7)
- if tonumber(choice) then
- speed = choice
- song.PlaybackSpeed = tonumber(speed)
- end
- end
- --
- if msg:lower():sub(1,9) == "/e speed" ..prefix then
- local choice = msg:lower():sub(10)
- if tonumber(choice) then
- speed = choice
- song.PlaybackSpeed = tonumber(speed)
- end
- end
- --
- if msg:lower():sub(1,6) == "style" ..prefix then
- local choice = msg:lower():sub(7)
- if tonumber(choice) and (choice == "1" or choice == "2" or choice == "3" or choice == "4" or choice == "5" or choice == "6") then
- mode = tonumber(choice)
- end
- end
- --
- if msg:lower():sub(1,9) == "/e style" ..prefix then
- local choice = msg:lower():sub(10)
- if tonumber(choice) and (choice == "1" or choice == "2" or choice == "3" or choice == "4" or choice == "5" or choice == "6") then
- mode = tonumber(choice)
- end
- end
- --
- end)
Add Comment
Please, Sign In to add comment