Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if owner then
- if game.PlaceId == 843468296 or game.PlaceId == 843495510 or game.PlaceId == 897312463 then
- wait(1)
- local char = owner.Character
- if char then
- local radioModel = Instance.new("Model",workspace)
- radioModel.Name = "Radio"
- local P_1 = Instance.new("Part",radioModel)
- P_1.CFrame = char.Head.CFrame * CFrame.new(0,5,0)
- P_1.Size = Vector3.new(3, 2, 1)
- radioModel.PrimaryPart = P_1
- P_1.Anchored = true
- local SG = Instance.new("SurfaceGui",P_1)
- local TB = Instance.new("TextBox",SG)
- TB.BackgroundColor3 = Color3.fromRGB(255, 255, 255)
- TB.Size = UDim2.new(1, 0,0.5, 0)
- TB.Font = Enum.Font.SciFi
- TB.PlaceholderText = "ID here."
- TB.TextColor3 = Color3.fromRGB(0, 0, 0)
- TB.TextScaled = true
- TB.Text = ""
- local TButton = Instance.new("TextButton",SG)
- TButton.BackgroundColor3 = Color3.fromRGB(13, 255, 1)
- TButton.Size = UDim2.new(1, 0,0.5, 0)
- TButton.Font = Enum.Font.SciFi
- TButton.Text = "Playing"
- TButton.TextColor3 = Color3.fromRGB(0,0,0)
- TButton.TextScaled = true
- TButton.Position = UDim2.new( 1, 0,1, 0)
- TButton.AnchorPoint = Vector2.new(1,1)
- local P_2 = Instance.new("Part",radioModel)
- P_2.CanCollide = false
- P_2.CFrame = P_1.CFrame * CFrame.new(1.5,0,0)
- P_2.Orientation = P_1.Orientation + Vector3.new(0, 0, -90)
- P_2.Size = Vector3.new(2, 1, 1)
- P_2.Shape = "Cylinder"
- local P_3 = Instance.new("Part",radioModel)
- P_3.CanCollide = false
- P_3.CFrame = P_1.CFrame * CFrame.new(-1.5,0,0)
- P_3.Orientation = P_1.Orientation + Vector3.new(0, 0, -90)
- P_3.Size = Vector3.new(2, 1, 1)
- P_3.Shape = "Cylinder"
- local P_4 = Instance.new("Part",radioModel)
- P_4.CanCollide = false
- P_4.CFrame = P_1.CFrame * CFrame.new(0,1,0)
- P_4.Orientation = P_1.Orientation + Vector3.new(0, 0, -180)
- P_4.Size = Vector3.new(3, 1, 1)
- P_4.Shape = "Cylinder"
- local P_5 = Instance.new("Part",radioModel)
- P_5.CanCollide = false
- P_5.CFrame = P_1.CFrame * CFrame.new(1.5,1,0)
- P_5.Size = Vector3.new(1, 1, 1)
- P_5.Shape = "Ball"
- local P_6 = Instance.new("Part",radioModel)
- P_6.CanCollide = false
- P_6.CFrame = P_1.CFrame * CFrame.new(-1.5,1,0)
- P_6.Size = Vector3.new(1, 1, 1)
- P_6.Shape = "Ball"
- local P_7 = Instance.new("Part",radioModel)
- P_7.CanCollide = false
- P_7.CFrame = P_1.CFrame * CFrame.new(-.875,1.5,0)
- P_7.Orientation = P_1.Orientation + Vector3.new(00, 0, 90)
- P_7.Size = Vector3.new(0.75, 0.25, 0.25)
- P_7.Shape = "Cylinder"
- local P_8 = Instance.new("Part",radioModel)
- P_8.CanCollide = false
- P_8.CFrame = P_1.CFrame * CFrame.new(.875,1.5,0)
- P_8.Orientation = P_1.Orientation + Vector3.new(00, 0, 90)
- P_8.Size = Vector3.new(0.75, 0.25, 0.25)
- P_8.Shape = "Cylinder"
- local P_9 = Instance.new("Part",radioModel)
- P_9.CanCollide = false
- P_9.CFrame = P_1.CFrame * CFrame.new(.875,1.875,0)
- P_9.Size = Vector3.new(0.25, 0.25, 0.25)
- P_9.Shape = "Ball"
- local P_10 = Instance.new("Part",radioModel)
- P_10.CanCollide = false
- P_10.CFrame = P_1.CFrame * CFrame.new(-.875,1.875,0)
- P_10.Size = Vector3.new(0.25, 0.25, 0.25)
- P_10.Shape = "Ball"
- local P_11 = Instance.new("Part",radioModel)
- P_11.CanCollide = false
- P_11.CFrame = P_1.CFrame * CFrame.new(0,1.875,0)
- P_11.Orientation = P_11.Orientation + Vector3.new(0, 0, 180)
- P_11.Size = Vector3.new(1.75, 0.25, 0.25)
- P_11.Shape = "Cylinder"
- local RCC = radioModel:GetDescendants()
- for _, v in pairs(RCC) do
- if v:IsA("Part") then
- local weld_1 = Instance.new("WeldConstraint",radioModel.PrimaryPart)
- weld_1.Part0 = radioModel.PrimaryPart
- weld_1.Part1 = v
- v.Material = Enum.Material.Glass
- v.CanCollide = true
- v.Massless = true
- end
- end
- local P_12 = Instance.new("Part",workspace)
- P_12.Position = Vector3.new(0,5,0)
- P_12.Transparency = 1
- P_12.CanCollide = false
- P_12.Anchored = true
- local at_1 = Instance.new("Attachment",P_12)
- at_1.Orientation = Vector3.new(0,0,90)
- local at_2 = Instance.new("Attachment",P_1)
- at_2.Visible = true
- at_2.Orientation = Vector3.new(0,0,90)
- local ao_1 = Instance.new("AlignOrientation",P_1)
- ao_1.Attachment0 = at_2
- ao_1.Attachment1 = at_1
- ao_1.PrimaryAxisOnly = true
- ao_1.RigidityEnabled = true
- P_1.Anchored = false
- print("Radio by CHL")
- print("Prefix = /")
- print(" - Chat commands - ")
- print("===================")
- print("/music = <ID>")
- print("/play")
- print("/stop")
- print("/looped = <boolean value>")
- print("/vol = <Num value>")
- print("/destroy")
- owner.Chatted:Connect(function(msg)
- local length = string.len(msg)
- if string.lower(string.sub(msg,1,6))=="/music" then
- if string.find(msg,"=") then
- local b_1,b_2 = string.find(msg,"=")
- local startnum = b_1
- if string.find(msg," ",b_1 + 1) then
- startnum = b_1 + 1
- end
- local id = tonumber(string.sub(msg,startnum + 1,length))
- if id~="" and id~=" " and id then
- if P_1:FindFirstChildWhichIsA("Sound") then
- P_1:FindFirstChildWhichIsA("Sound").SoundId = "rbxassetid://"..id
- print("ID:"..id)
- else
- local sound = Instance.new("Sound",P_1)
- sound.SoundId = "rbxassetid://"..id
- print("ID:"..id)
- end
- TB.Text = tostring(id)
- end
- end
- elseif string.lower(string.sub(msg,1,5))=="/play" then
- if P_1:FindFirstChildWhichIsA("Sound",true) then
- P_1:FindFirstChildWhichIsA("Sound",true):Play()
- print("Playing music.")
- end
- elseif string.lower(string.sub(msg,1,5))=="/stop" then
- if P_1:FindFirstChildWhichIsA("Sound",true) then
- P_1:FindFirstChildWhichIsA("Sound",true):Stop()
- print("Stopped music.")
- end
- elseif string.lower(string.sub(msg,1,7))=="/looped" then
- if P_1:FindFirstChildWhichIsA("Sound",true) then
- if string.find(msg,"=") then
- local b_1,b_2 = string.find(msg,"=")
- local startnum = b_1
- if string.find(msg," ",b_1 + 1) then
- startnum = b_1 + 1
- end
- local bool = string.sub(msg,startnum + 1,length)
- if string.lower(string.sub(msg,startnum + 1,startnum + 4))=="true" or string.lower(string.sub(msg,startnum + 1,startnum + 5))=="false" then
- if P_1:FindFirstChildWhichIsA("Sound",true) then
- if string.lower(string.sub(msg,startnum + 1,startnum + 4))=="true" then
- P_1:FindFirstChildWhichIsA("Sound",true).Looped = true
- print("Music is now on loop.")
- else
- P_1:FindFirstChildWhichIsA("Sound",true).Looped = false
- print("Music is no longer on loop.")
- end
- end
- else
- end
- end
- end
- elseif string.lower(string.sub(msg,1,4))=="/vol" then
- local mus = P_1:FindFirstChildWhichIsA("Sound",true)
- if mus then
- if string.find(msg,"=") then
- local b_1,b_2 = string.find(msg,"=")
- local startnum = b_1
- if string.find(msg," ",b_1 + 1) then
- startnum = b_1 + 1
- end
- local vol = tonumber(string.sub(msg,startnum + 1,length))
- if vol>5 then
- vol = 5
- end
- if vol~="" and vol~=" " and vol then
- if P_1:FindFirstChildWhichIsA("Sound") then
- P_1:FindFirstChildWhichIsA("Sound").Volume = vol
- print("Volume: "..vol)
- end
- else
- end
- end
- end
- elseif string.lower(string.sub(msg,1,8))=="/destroy" then
- P_1:Destroy()
- for _, v in pairs(RCC) do
- if v:IsA("Part") then
- v.Anchored = false
- v.CanCollide = false
- end
- end
- elseif string.lower(string.sub(msg,1,7))=="/anchor" then
- P_1.Anchored = true
- if string.find(msg,"false") then
- P_1.Anchored = false
- end
- end
- end)
- char.Humanoid.Died:Connect(function()
- radioModel:Destroy()
- end)
- end
- end
- end
Add Comment
Please, Sign In to add comment