Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Visualizer made by fusionfriends, Enjoy :)
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- do
- print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
- script.Parent = Player.Character
- --RemoteEvent for communicating
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- --Fake event to make stuff like Mouse.KeyDown work
- local function fakeEvent()
- local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
- t.connect = t.Connect
- return t
- end
- --Creating fake input objects with fake variables
- local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function te(self,ev,...)
- local t = m[ev]
- if t and t._fakeEvent and t.Function then
- t.Function(...)
- end
- end
- m.TrigEvent = te
- UIS.TrigEvent = te
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=Player then return end
- if io.isMouse then
- m.Target = io.Target
- m.Hit = io.Hit
- else
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return m:TrigEvent(b and "Button1Down" or "Button1Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[
- local Player = game:GetService("Players").LocalPlayer
- local Event = script:WaitForChild("UserInput_Event")
- local UIS = game:GetService("UserInputService")
- local input = function(io,a)
- if a then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local Mouse = Player:GetMouse()
- local h,t
- --Give the server mouse data 30 times every second, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- while wait(1/30) do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- end]==],Player.Character)
- Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
- end
- local Player = owner
- local TweenService = game:GetService("TweenService")
- local PlayerGui = Player.PlayerGui
- local Character = Player.Character
- local RootPart = Character.HumanoidRootPart
- local Part = Instance.new("Part",workspace)
- Part.Size = Vector3.new(2,2,2)
- Part.CanCollide = false
- Part.Name = "Visualizer"
- Part.Material = Enum.Material.SmoothPlastic
- Part.BrickColor = BrickColor.new("Black")
- Part.Anchored = true
- local Mesh = Instance.new("SpecialMesh",Part)
- Mesh.MeshId = "rbxassetid://1254392112"
- Mesh.Scale = Vector3.new(0.2,0.4,0.2)
- local Part2 = Instance.new("Part",workspace)
- local Part3 = Instance.new("Part",workspace)
- local Mesh2 = Instance.new("SpecialMesh",Part2)
- local Mesh3 = Instance.new("SpecialMesh",Part3)
- local Weld = Instance.new("Weld",Part2)
- local Weld2 = Instance.new("Weld",Part3)
- Part2.BrickColor = BrickColor.new("Really black")
- Part2.Material = Enum.Material.Neon
- Part2.Size = Vector3.new(2,1,2)
- Part2.CanCollide = false
- Part3.BrickColor = BrickColor.new("Really black")
- Part3.Material = Enum.Material.Neon
- Part3.Size = Vector3.new(2,1,2)
- Part3.CanCollide = false
- Mesh2.MeshId = "rbxassetid://2913878791"
- Mesh2.Scale = Vector3.new(0.1,0.1,0.05)
- Mesh3.MeshId = "rbxassetid://2913878791"
- Mesh3.Scale = Vector3.new(0.1,0.1,0.05)
- Weld.Part1 = Part
- Weld.Part0 = Part2
- Weld2.Part1 = Part
- Weld2.Part0 = Part3
- local Part4 = Instance.new("Part",workspace)
- Part4.Material = Enum.Material.Neon
- Part4.BrickColor = BrickColor.new("Really black")
- Part4.CanCollide = false
- local Mesh4 = Instance.new("SpecialMesh",Part4)
- Mesh4.MeshId = "rbxassetid://489415447"
- local Weld4 = Instance.new("Weld",Part)
- Weld4.Part1 = Part
- Weld4.Part0 = Part4
- Weld4.C0 = CFrame.new(0,12,0)
- local Music = Instance.new("Sound",owner.Character.Torso)
- Music.Name = "Music"
- Music.Looped = true
- Music.Volume = 7
- Player.Chatted:Connect(function(Message)
- if Message:sub(1,5)=="Play/" or "play/" then
- local Id = Message:sub(6,#Message)
- if tonumber(Id) then
- print(Id)
- Music.SoundId = ("rbxassetid://"..Id)
- Music:Play()
- end
- end
- end)
- local LoudnessEvent = Instance.new("RemoteEvent")
- LoudnessEvent.Name = "LoudnessEvent"
- LoudnessEvent.Parent = NLS([==[
- local Music = owner.Character.Torso:WaitForChild("Music")
- local LoudnessEvent = script.LoudnessEvent
- game:GetService("RunService").Heartbeat:Connect(function()
- local loudness = Music.PlaybackLoudness
- LoudnessEvent:FireServer(loudness)
- end)
- ]==],owner.PlayerGui)
- LoudnessEvent.OnServerEvent:Connect(function(player,loudness)
- Loudness = loudness
- while true do
- wait()
- Part.CFrame = Part.CFrame:Lerp(CFrame.new(RootPart.Position.X,RootPart.Position.Y+10,RootPart.Position.Z),.6)
- Weld.C0 = Weld.C0*CFrame.Angles(0,math.rad(Loudness/50),0)
- Weld2.C0 = Weld2.C0*CFrame.Angles(math.rad(-Loudness/50),0,0)
- Mesh2.Scale = Vector3.new(Loudness/5000+.1,Loudness/5000+.1,Mesh2.Scale.Z)
- Mesh3.Scale = Vector3.new(Loudness/5000+.1,Loudness/5000+.1,Mesh3.Scale.Z)
- Part2.BrickColor = BrickColor.new(Loudness/300,0,0)
- Part.BrickColor = BrickColor.new(Loudness/300,0,0)
- Part3.BrickColor = BrickColor.new(Loudness/300,0,0)
- Part4.BrickColor = BrickColor.new(Loudness/300,0,0)
- Weld4.C0 = Weld4.C0*CFrame.Angles(0,math.rad(Loudness/50),0)
- Mesh4.Scale = Vector3.new(Loudness/100+5,3,Loudness/100+5)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement