Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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")
- 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
- print([[
- This is my attempt at making an actual working visulizer.
- Credit to Kyutatsuki for "helping" me make this. Really couldn't have done this myself.
- - Theamazingnater
- P.S. More visulizers coming your way!
- Controls:
- play/(id)
- stop
- antideath on
- antideath off
- loop on
- loop off
- ]])
- wait(1/60)
- player = game.Players.LocalPlayer
- char = player.Character
- rs = game:GetService("RunService").RenderStepped
- local Radio = Instance.new("Part",char)
- Radio.CanCollide = false
- local RadioMesh = Instance.new("FileMesh",Radio)
- RadioMesh.MeshId = "rbxassetid://151760030"
- RadioMesh.TextureId = "rbxassetid://151760072"
- RadioMesh.Scale = Vector3.new(0.7,0.7,0.7)
- local RadioWeld = Instance.new("Weld",Radio)
- RadioWeld.Part0 = Radio
- RadioWeld.Part1 = char.Torso
- RadioWeld.C0 = CFrame.new(-0.0894899368, -0.236836433, 0.787712097, -0.867854834, 0.496817887, 0, 0.496817887, 0.867854834, 0, 0, 0, -1)
- local Sound = Instance.new("Sound",Radio)
- Sound.Volume = 4
- Sound.SoundId = "rbxassetid://"
- OriginalSize = Vector3.new(0.7,0.7,0.7)
- CanDie = true
- market = game:GetService("MarketplaceService")
- local BODY = {}
- LeftArm = char["Left Arm"]
- RightLeg = char["Right Leg"]
- LeftLeg = char["Left Leg"]
- for _, c in pairs(char:GetDescendants()) do
- if c:IsA("BasePart") and c.Name ~= "Handle" then
- if c ~= char.HumanoidRootPart and c ~= char.Torso and c ~= char.Head and c ~= char["Right Arm"] and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
- c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
- end
- table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency})
- elseif c:IsA("JointInstance") then
- table.insert(BODY,{c,c.Parent,nil,nil,nil})
- end
- end
- for e = 1, #BODY do
- if BODY[e] ~= nil then
- local STUFF = BODY[e]
- local PART = STUFF[1]
- local PARENT = STUFF[2]
- local MATERIAL = STUFF[3]
- local TRANSPARENCY = STUFF[5]
- if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
- PART.Material = MATERIAL
- PART.Transparency = TRANSPARENCY
- end
- PART.AncestryChanged:Connect(function()
- PART.Parent = PARENT
- end)
- end
- end
- function refit()
- char.Parent = workspace
- for e = 1, #BODY do
- if BODY[e] ~= nil then
- local STUFF = BODY[e]
- local PART = STUFF[1]
- local PARENT = STUFF[2]
- local MATERIAL = STUFF[3]
- local TRANSPARENCY = STUFF[5]
- if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
- PART.Material = MATERIAL
- PART.Transparency = TRANSPARENCY
- end
- if PART.Parent ~= PARENT then
- char:FindFirstChildOfClass("Humanoid"):remove()
- PART.Parent = PARENT
- Humanoid = Instance.new("Humanoid",char)
- end
- end
- end
- end
- char.Humanoid.Died:connect(function()
- if CanDie == false then
- refit()
- end
- end)
- player.Chatted:connect(function(msg)
- if msg:sub(1,5) == "play/" then
- Sound:Stop()
- Sound.SoundId = "rbxassetid://" .. msg:sub(6)
- Sound:Play()
- Music = market:GetProductInfo(msg:sub(6))
- print("Now playing, " .. Music.Name)
- end
- if msg == "stop" then
- Sound:Stop()
- print("Stopped the music/sound.")
- end
- if msg == "antideath on" then
- CanDie = false
- print("Antideath has been activated!")
- end
- if msg == "antideath off" then
- CanDie = true
- print("Oof! Antideath has been deactivated.")
- end
- if msg == "loop on" then
- print("Looping on!")
- Sound.Looped = true
- end
- if msg == "loop off" then
- print("Looping off!")
- Sound.Looped = false
- end
- end)
- while rs:wait() do
- if CanDie == false then
- refit()
- end
- Sound.Parent = Radio
- RadioMesh.Scale = RadioMesh.Scale:lerp(Vector3.new(OriginalSize.X+Sound.PlaybackLoudness/4000*3.5,OriginalSize.Y+Sound.PlaybackLoudness/4000*3.5,OriginalSize.Z+Sound.PlaybackLoudness/4000*3.5),0.8)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement