Advertisement
NightGamingVN

public script 9 - orb

Jun 16th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.20 KB | None | 0 0
  1. -- another music visuallizer by pdnghiaqoi [marseio]
  2. -- server side version, run with r/ or h/
  3. Tool0 = Instance.new("Tool")
  4. RemoteEvent1 = Instance.new("RemoteEvent")
  5. Part2 = Instance.new("Part")
  6. ParticleEmitter3 = Instance.new("ParticleEmitter")
  7. RemoteEvent4 = Instance.new("RemoteEvent")
  8. Tool0.Name = "Bullet Gen"
  9. Tool0.Parent = owner.Backpack
  10. Tool0.TextureId = "rbxassetid://1658260779"
  11. RemoteEvent1.Name = "REbullet"
  12. RemoteEvent1.Parent = Tool0
  13. Part2.Name = "Handle"
  14. Part2.Parent = Tool0
  15. Part2.CFrame = CFrame.new(-6.13870192, 0.625011981, -11.4352417, -0.227088049, -0.0310423523, -0.973379433, -0.0164190568, 0.999471784, -0.0280439258, 0.973735809, 0.00961352512, -0.227477789)
  16. Part2.Orientation = Vector3.new(1.61000001, -103.150002, -0.939999998)
  17. Part2.Position = Vector3.new(-6.13870192, 0.625011981, -11.4352417)
  18. Part2.Rotation = Vector3.new(172.970001, -76.75, 172.220001)
  19. Part2.Color = Color3.new(1, 1, 0)
  20. Part2.Size = Vector3.new(1.25, 1.25, 1.25)
  21. Part2.BottomSurface = Enum.SurfaceType.Smooth
  22. Part2.BrickColor = BrickColor.new("New Yeller")
  23. Part2.CanCollide = false
  24. Part2.Material = Enum.Material.Neon
  25. Part2.TopSurface = Enum.SurfaceType.Smooth
  26. Part2.brickColor = BrickColor.new("New Yeller")
  27. Part2.Shape = Enum.PartType.Ball
  28. ParticleEmitter3.Parent = Part2
  29. ParticleEmitter3.Speed = NumberRange.new(0, 0)
  30. ParticleEmitter3.Rotation = NumberRange.new(180, 180)
  31. ParticleEmitter3.LightEmission = 2
  32. ParticleEmitter3.LightInfluence = 1
  33. ParticleEmitter3.Lifetime = NumberRange.new(0.5, 0.5)
  34. ParticleEmitter3.LockedToPart = true
  35. ParticleEmitter3.Rate = 23
  36. ParticleEmitter3.RotSpeed = NumberRange.new(-40, -40)
  37. ParticleEmitter3.SpreadAngle = Vector2.new(0, 360)
  38. RemoteEvent4.Name = "REloud"
  39. RemoteEvent4.Parent = Tool0
  40. local Tool = Tool0
  41. local handle = Part2
  42. local REb = RemoteEvent1
  43. local REl = RemoteEvent4
  44. local mt = 1000/7.5
  45. local setting = {
  46. vol = 1;
  47. pit = 1;
  48. id = 2524773485;
  49. loop = true;
  50. updated = false;
  51. target = nil;
  52. }
  53. play = owner
  54. char = play.Character
  55. hum = char.Humanoid
  56. root = char.HumanoidRootPart
  57.  
  58. sound = Instance.new("Sound")
  59. sound.Name = "mainSound"
  60. sound.Parent = owner.Character:WaitForChild("Head")
  61. sound.Volume = setting.vol
  62. sound.Pitch = setting.pit
  63. sound.SoundId = "rbxassetid://"..setting.id
  64. sound.Looped = setting.loop
  65.  
  66.  
  67. local en = true
  68. --["hl"] = ???; ["defsize"] = 0.5
  69. local fb = {}
  70. if hum.Health > 0 then
  71. REb.OnServerEvent:connect(function(plr,mousehit)
  72. wait(0.1)
  73. local Handle = handle
  74. local handleCFrame = Handle.CFrame
  75. local firingPoint = handleCFrame.p
  76. local shotCFrame = CFrame.new(firingPoint,mousehit.p)
  77. local fireball = Handle:clone()
  78. fireball.CFrame = shotCFrame
  79. local bv = Instance.new("BodyVelocity")
  80. bv.Velocity = shotCFrame.lookVector * 25
  81. bv.Parent = fireball
  82. fireball.CanCollide = false
  83. fireball.Parent = workspace
  84. local ab = 0.1
  85. fireball.Size = Vector3.new(ab,ab,ab)
  86. fireball.BrickColor = BrickColor.palette(math.random(127))
  87. table.insert(fb,{["hl"] = fireball; ["defsize"] = ab})
  88. local ten = true
  89. fireball.Touched:connect(function(hit)
  90. if not hit.Parent:IsA("Model") then return end
  91. if hit.Parent == plr.Character then return end
  92. if not ten then return end
  93. ten = false
  94. local ehum = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid")
  95. if ehum then
  96. ehum.Health = 0
  97. for i=1,4 do
  98. local part = fireball:clone()
  99. part.Size = Vector3.new(0.5,0.5,0.5)
  100. part.CFrame = fireball.CFrame
  101. part.CanCollide = false
  102. part.BodyVelocity.Velocity = Vector3.new(math.random(-90,90),math.random(-90,90),math.random(-90,90))
  103. part.Parent = workspace
  104. game.Debris:AddItem(part,0.25)
  105. end
  106. fireball:Destroy()
  107. end
  108. wait()
  109. ten = true
  110. end)
  111. wait(10)
  112. fireball:Destroy()
  113. end)
  114. end
  115. function emptycheck(tabl)
  116. for i, v in pairs(tabl) do
  117. return false
  118. end
  119. return true
  120. end
  121. spawn(function()
  122. REl.OnServerEvent:Connect(function(unimport,loud)
  123. local df = loud / mt
  124. local lnd = df + 0.5
  125. handle.Size = Vector3.new(lnd,lnd,lnd)
  126. if emptycheck(fb) then return end
  127. local a = 0
  128. spawn(function()
  129. for i,v in pairs(fb) do
  130. a = a + 1
  131. if v["hl"].Parent == nil then
  132. table.remove(fb, a)
  133. end
  134. local da = df + v["defsize"]
  135. v["hl"].Size = Vector3.new(da,da,da)
  136. end
  137. end)
  138. end)
  139. end)
  140. equip = false
  141. Tool.Equipped:Connect(function()
  142. equip = true
  143. if sound and sound.Playing == false then
  144. sound:Resume()
  145. end
  146. end)
  147.  
  148. Tool.Unequipped:Connect(function()
  149. equip = false
  150. if sound and sound.Playing == true then
  151. sound:Pause()
  152. end
  153. end)
  154.  
  155. NLS([==[
  156. local tmpGo = true
  157. local Tool = script.Parent
  158. play = owner
  159. char = play.Character
  160. local sound = owner.Character:WaitForChild("Head"):WaitForChild("mainSound")
  161. Tool.Equipped:connect(function(mouse)
  162. mouse.Button1Down:connect(function()
  163. Tool.REbullet:FireServer(mouse.Hit)
  164. end)
  165. end)
  166.  
  167. spawn(function()
  168. while wait() do
  169. if not sound then
  170. sound = owner.Character:WaitForChild("Head"):WaitForChild("mainSound")
  171. end
  172. if sound and sound.Playing == true then
  173. Tool.REloud:FireServer(sound.PlaybackLoudness)
  174. end
  175. end
  176. end)
  177. ]==],Tool0)
  178. function update()
  179. pcall(function()
  180. if not sound then resound() end
  181. if setting.updated == false or not setting.target then return end
  182. wait()
  183. if setting.target == "volume" then
  184. sound.Volume = setting.vol
  185. elseif setting.target == "pitch" then
  186. sound.Pitch = setting.pitch
  187. elseif setting.target == "sound" then
  188. sound:Stop()
  189. sound.SoundId = "rbxassetid://"..setting.id
  190. sound:Play()
  191. elseif setting.target == "loop" then
  192. sound.Looped = setting.loop
  193. end
  194. print("current settings\nvolume = "..setting.vol.."\npitch = "..setting.pit.."\nloop = "..tostring(setting.loop).."\nsound = "..setting.id.." | "..game:GetService("MarketplaceService"):GetProductInfo(setting.id).Name)
  195. setting.updated = false
  196. end)
  197. end
  198. function resound()
  199. if sound then sound:Destroy() end
  200. sound = Instance.new("Sound")
  201. sound.Name = "mainSound"
  202. sound.Parent = owner.Character:WaitForChild("Head")
  203. sound.Volume = setting.vol
  204. sound.Pitch = setting.pit
  205. sound.SoundId = "rbxassetid://"..setting.id
  206. sound.Looped = setting.loop
  207. if equip == true then
  208. sound:Resume()
  209. elseif equip == false then
  210. sound:Pause()
  211. end
  212. end
  213. spawn(function()
  214. while wait() do
  215. update()
  216. end
  217. end)
  218. function upd(target)
  219. setting.updated = true
  220. setting.target = target
  221. end
  222. owner.Chatted:Connect(function(msg)
  223. local mes = msg
  224. if string.sub(msg, 1,3) == "/e " then
  225. mes = string.sub(msg,4)
  226. end
  227. if string.sub(mes,1,5) == "/vol " then
  228. if not tonumber(string.sub(mes,6)) then return end
  229. setting.vol = tonumber(string.sub(mes,6))
  230. upd("volume")
  231. elseif string.sub(mes,1,5) == "/pit " then
  232. if not tonumber(string.sub(mes,5)) then return end
  233. setting.pit = tonumber(string.sub(mes,6))
  234. upd("pitch")
  235. elseif string.sub(mes,1,4) == "/id " then
  236. if not tonumber(string.sub(mes,5)) then return end
  237. setting.id = tonumber(string.sub(mes,5))
  238. upd("sound")
  239. elseif string.sub(mes,1,6) == "/loop " then
  240. if string.sub(mes,7) == "true" then
  241. setting.loop = true
  242. elseif string.sub(mes,7) == "false" then
  243. setting.loop = false
  244. else return end
  245. upd("loop")
  246. elseif string.sub(mes,1,5) == "/r" then
  247. resound()
  248. end
  249. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement