Advertisement
NightGamingVN

public script 10 - client orb

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