Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DJ = "Player1"
- playlist = {
- {
- Asset = 157705295;
- Length = 111;
- },
- {
- Asset = 142468746;
- Length = 120;
- },
- {
- Asset = 162261155;
- Length = 74;
- },
- {
- Asset = 162258269;
- Length = 118;
- },
- {
- Asset = 142402325;
- Length = 214.5;
- Pitch = 0.575;
- }
- }
- function stopAllSound(obj)
- local function recurse(o)
- for _,v in pairs(o:GetChildren()) do
- if v:IsA("Sound") then
- v:Stop()
- v:Destroy()
- else
- recurse(v)
- end
- end
- end
- recurse(obj)
- end
- function Create(ty)
- return function(data)
- local obj = Instance.new(ty)
- for k, v in pairs(data) do
- if type(k) == 'number' then
- v.Parent = obj
- else
- obj[k] = v
- end
- end
- return obj
- end
- end
- stopAllSound(workspace)
- priority = "Random";
- state = 3;
- localState = 3;
- up = 1
- down = 0.25
- states = {"Static-On","Strobe","Off"};
- Colors = {
- Red = Vector3.new(1,0,0);
- Green = Vector3.new(0,1,0);
- Blue = Vector3.new(0,0,1);
- White = Vector3.new(1,1,1);
- }
- player = game.Players:findFirstChild(DJ)
- if not player then
- error("UNABLE TO FIND DJ. SESSION ABORTED")
- end
- if not player:findFirstChild("PlayerGui") then
- error("UNABLE TO FIND DJ's PLAYERGUI. ABORTED")
- end
- gui = Create'ScreenGui'{
- Parent = player.PlayerGui;
- Create'Frame'{
- Size = UDim2.new(0.2, 0, 0, 470);
- Draggable = true;
- Style = Enum.FrameStyle.RobloxRound;
- Position = UDim2.new(0.775, 0, 0.15, 0);
- BackgroundColor3 = Color3.new(1, 1, 1);
- Create'StringValue'{
- Name = "LightingPriority";
- Value = "Random";
- };
- Create'IntValue'{
- Name = "UpFlashRate";
- };
- Create'IntValue'{
- Name = "DownFlashRate";
- };
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size24;
- Text = "DJ Lighting Thing";
- Size = UDim2.new(1, 0, 0.15, 0);
- Draggable = true;
- TextColor3 = Color3.new(1, 1, 1);
- Font = Enum.Font.SourceSansBold;
- Name = "Title";
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- Create'Frame'{
- Size = UDim2.new(1, 0, 1, 0);
- Name = "LightingSet";
- Position = UDim2.new(0.225, 0, 0, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- Create'TextButton'{
- FontSize = Enum.FontSize.Size14;
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Name = "Red";
- Text = "Lighting Priority Red";
- Size = UDim2.new(0.5, 0, 0, 30);
- TextColor3 = Color3.new(1, 0, 0);
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0, 0, 0.175, 0);
- };
- Create'TextButton'{
- FontSize = Enum.FontSize.Size14;
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Name = "Green";
- Text = "Lighting Priority Green";
- Size = UDim2.new(0.5, 0, 0, 30);
- TextColor3 = Color3.new(0, 1, 0);
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0, 0, 0.175, 40);
- };
- Create'TextButton'{
- FontSize = Enum.FontSize.Size14;
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Name = "Blue";
- Text = "Lighting Priority Blue";
- Size = UDim2.new(0.5, 0, 0, 30);
- TextColor3 = Color3.new(0, 0, 1);
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0, 0, 0.175, 80);
- };
- Create'TextButton'{
- FontSize = Enum.FontSize.Size14;
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Name = "White";
- Text = "Lighting Priority White";
- Size = UDim2.new(0.5, 0, 0, 30);
- TextColor3 = Color3.new(1, 1, 1);
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0, 0, 0.175, 120);
- };
- Create'TextButton'{
- FontSize = Enum.FontSize.Size14;
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Name = "Random";
- Text = "Random Lighting";
- Size = UDim2.new(0.5, 0, 0, 30);
- TextColor3 = Color3.new(1, 1, 0);
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0, 0, 0.175, 160);
- };
- };
- Create'TextButton'{
- FontSize = Enum.FontSize.Size14;
- Modal = true;
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Name = "StrobeToggle";
- Text = "Lighting: Off";
- Size = UDim2.new(0.5, 0, 0, 30);
- TextColor3 = Color3.new(1, 1, 1);
- Font = Enum.Font.SourceSansBold;
- Position = UDim2.new(0.225, 0, 0.175, 210);
- };
- Create'TextBox'{
- FontSize = Enum.FontSize.Size14;
- Text = "0.25";
- Size = UDim2.new(0.4, 0, 0, 30);
- TextColor3 = Color3.new(1, 1, 1);
- Font = Enum.Font.SourceSans;
- Name = "DownRate";
- Position = UDim2.new(0.05, 0, 0.75, 0);
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size14;
- Text = "Flash Down Time";
- Size = UDim2.new(1, 0, 0.5, 0);
- TextColor3 = Color3.new(1, 1, 1);
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0, 0, -0.6, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- Create'TextBox'{
- FontSize = Enum.FontSize.Size14;
- Text = "1";
- Size = UDim2.new(0.4, 0, 0, 30);
- TextColor3 = Color3.new(1, 1, 1);
- MultiLine = true;
- Font = Enum.Font.SourceSans;
- Name = "UpRate";
- Position = UDim2.new(0.55, 0, 0.75, 0);
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Create'TextLabel'{
- FontSize = Enum.FontSize.Size14;
- Text = "Flash Up Time";
- Size = UDim2.new(1, 0, 0.5, 0);
- TextColor3 = Color3.new(1, 1, 1);
- Font = Enum.Font.SourceSans;
- Position = UDim2.new(0, 0, -0.6, 0);
- BackgroundTransparency = 1;
- BackgroundColor3 = Color3.new(1, 1, 1);
- };
- };
- Create'TextButton'{
- FontSize = Enum.FontSize.Size14;
- Modal = true;
- BackgroundColor3 = Color3.new(0.278431, 0.278431, 0.278431);
- Name = "Push";
- Text = "START PLAYLIST";
- Size = UDim2.new(0.75, 0, 0, 30);
- TextColor3 = Color3.new(1, 1, 1);
- Font = Enum.Font.SourceSansBold;
- Position = UDim2.new(0.125, 0, 0.875, 0);
- };
- Create'StringValue'{
- Name = "State";
- Value = "Static";
- };
- };
- }
- gui.Frame.DownRate.FocusLost:connect(function ()
- if not tonumber(gui.Frame.DownRate.Text) then
- gui.Frame.DownRate.Text = down
- end
- end)
- gui.Frame.UpRate.FocusLost:connect(function ()
- if not tonumber(gui.Frame.UpRate.Text) then
- gui.Frame.UpRate.Text = up
- end
- end)
- gui.Frame.StrobeToggle.MouseButton1Down:connect(function ()
- localState = (localState == 3) and 1 or localState + 1
- gui.Frame.StrobeToggle.Text = "Lighting: "..states[localState]
- end)
- gui.Frame.Push.MouseButton1Down:connect(function ()
- gui.Frame.Push.Text = "UPDATE W/ CURRENT VALUES"
- start = true
- priority = gui.Frame.LightingPriority.Value
- state = localState
- up = gui.Frame.UpFlashRate.Value
- down = gui.Frame.DownFlashRate.Value
- end)
- for _,v in pairs(gui.Frame.LightingSet:GetChildren()) do
- v.MouseButton1Down:connect(function ()
- gui.Frame.LightingPriority.Value = v.Name
- for _,a in pairs(gui.Frame.LightingSet:GetChildren()) do
- local c = 0.27450980392157 * (gui.Frame.LightingPriority.Value == a.Name and 2 or 1)
- a.BackgroundColor3 = Color3.new(c,c,c)
- end
- end)
- end
- lastUp = 0
- lastDown = 0
- currentDir = "Down"
- song = 0
- lastSong = 0
- lastSound = nil
- currentSound = nil
- start = false
- lUpdate = 0
- h = Instance.new("Hint",workspace)
- local function stopAudio(o)
- for _,v in pairs(o:GetChildren()) do
- if v:IsA("Sound") then
- v:Stop()
- v.Volume = 0
- v:Destroy()
- else
- stopAudio(v)
- end
- end
- end
- stopAudio(workspace)
- audio = Instance.new("Sound",workspace)
- audio.Name = "Main";
- while wait() do
- if tick()-lUpdate > .1 then
- lUpdate = tick()
- local n
- if state == 1 then
- n = priority == "Random" and Vector3.new(.7,.7,.7) or Colors[priority]
- elseif state == 2 then
- n = priority == "Random" and Vector3.new(math.random(),math.random(),math.random()) or Colors[priority]*math.random()
- elseif state == 3 then
- n = Vector3.new()
- end
- if tick()-lastDown >= down and down ~= 0 then
- lastUp = tick()
- lastDown = math.huge
- currentDir = "Up"
- elseif tick()-lastUp >= up and up ~= 0 then
- lastDown = tick()
- lastUp = math.huge
- currentDir = "Down"
- end
- n = currentDir == "Down" and not state == 3 and Vector3.new() or n
- local o = n*.75
- game.Lighting.OutdoorAmbient = Color3.new(n.X,n.Y,n.Z)
- game.Lighting.Ambient = Color3.new(o.X,o.Y,o.Z)
- end
- if start and (song == 0 or tick()-lastSong > playlist[song].Length) then
- song = song + 1
- audio:Stop()
- local nextSong = playlist[song]
- if nextSong then
- local assetID = playlist[song].Asset
- local songName = game:GetService("MarketplaceService"):GetProductInfo(assetID).Name
- h.Text = "Now Playing: '"..songName.."'"
- lastSong = tick()
- audio.SoundId = "rbxassetid://"..assetID
- audio.Pitch = playlist[song].Pitch or 1
- audio:Play()
- else
- local m = Instance.new("Message",workspace)
- m.Text = "Unfortunately, thats all we have time for today :("
- wait(2)
- m.Text = "This DJing session actually destroyed the script causing the previous audio to loop..."
- wait(2)
- m.Text = "So this server is unfortunately useless now. Have a nice day :D!"
- wait(1)
- for _,v in pairs(game.Players:GetPlayers()) do
- v:Kick()
- end
- Instance.new("ManualSurfaceJointInstance",workspace)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement