SHOW:
|
|
- or go back to the newest paste.
1 | -- This script has been converted to FE by iPxter | |
2 | ||
3 | ||
4 | if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end | |
5 | local Player,Mouse,mouse,UserInputService,ContextActionService = owner | |
6 | do | |
7 | print("FE Compatibility code by Mokiros | Translated to FE by iPxter") | |
8 | script.Parent = Player.Character | |
9 | ||
10 | --RemoteEvent for communicating | |
11 | local Event = Instance.new("RemoteEvent") | |
12 | Event.Name = "UserInput_Event" | |
13 | ||
14 | --Fake event to make stuff like Mouse.KeyDown work | |
15 | local function fakeEvent() | |
16 | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end} | |
17 | t.connect = t.Connect | |
18 | return t | |
19 | end | |
20 | print([[ | |
21 | This is my attempt at making an actual working visulizer. | |
22 | Credit to Kyutatsuki for "helping" me make this. Really couldn't have done this myself. | |
23 | - Theamazingnater | |
24 | ||
25 | P.S. More visulizers coming your way! | |
26 | ||
27 | ||
28 | Controls: | |
29 | play/(id) | |
30 | stop | |
31 | antideath on | |
32 | antideath off | |
33 | loop on | |
34 | loop off | |
35 | ]]) | |
36 | ||
37 | wait(1/60) | |
38 | player = game.Players.LocalPlayer | |
39 | char = player.Character | |
40 | rs = game:GetService("RunService").RenderStepped | |
41 | ||
42 | ||
43 | local Radio = Instance.new("Part",char) | |
44 | Radio.CanCollide = false | |
45 | local RadioMesh = Instance.new("FileMesh",Radio) | |
46 | RadioMesh.MeshId = "rbxassetid://151760030" | |
47 | RadioMesh.TextureId = "rbxassetid://151760072" | |
48 | RadioMesh.Scale = Vector3.new(0.7,0.7,0.7) | |
49 | local RadioWeld = Instance.new("Weld",Radio) | |
50 | RadioWeld.Part0 = Radio | |
51 | RadioWeld.Part1 = char.Torso | |
52 | RadioWeld.C0 = CFrame.new(-0.0894899368, -0.236836433, 0.787712097, -0.867854834, 0.496817887, 0, 0.496817887, 0.867854834, 0, 0, 0, -1) | |
53 | local Sound = Instance.new("Sound",Radio) | |
54 | Sound.Volume = 4 | |
55 | Sound.SoundId = "rbxassetid://" | |
56 | OriginalSize = Vector3.new(0.7,0.7,0.7) | |
57 | CanDie = true | |
58 | ||
59 | market = game:GetService("MarketplaceService") | |
60 | ||
61 | local BODY = {} | |
62 | LeftArm = char["Left Arm"] | |
63 | RightLeg = char["Right Leg"] | |
64 | LeftLeg = char["Left Leg"] | |
65 | for _, c in pairs(char:GetDescendants()) do | |
66 | if c:IsA("BasePart") and c.Name ~= "Handle" then | |
67 | 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 | |
68 | c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0) | |
69 | end | |
70 | table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency}) | |
71 | elseif c:IsA("JointInstance") then | |
72 | table.insert(BODY,{c,c.Parent,nil,nil,nil}) | |
73 | end | |
74 | end | |
75 | for e = 1, #BODY do | |
76 | if BODY[e] ~= nil then | |
77 | local STUFF = BODY[e] | |
78 | local PART = STUFF[1] | |
79 | local PARENT = STUFF[2] | |
80 | local MATERIAL = STUFF[3] | |
81 | local TRANSPARENCY = STUFF[5] | |
82 | if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then | |
83 | PART.Material = MATERIAL | |
84 | PART.Transparency = TRANSPARENCY | |
85 | end | |
86 | PART.AncestryChanged:Connect(function() | |
87 | PART.Parent = PARENT | |
88 | end) | |
89 | end | |
90 | end | |
91 | function refit() | |
92 | char.Parent = workspace | |
93 | for e = 1, #BODY do | |
94 | if BODY[e] ~= nil then | |
95 | local STUFF = BODY[e] | |
96 | local PART = STUFF[1] | |
97 | local PARENT = STUFF[2] | |
98 | local MATERIAL = STUFF[3] | |
99 | local TRANSPARENCY = STUFF[5] | |
100 | if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then | |
101 | PART.Material = MATERIAL | |
102 | PART.Transparency = TRANSPARENCY | |
103 | end | |
104 | if PART.Parent ~= PARENT then | |
105 | char:FindFirstChildOfClass("Humanoid"):remove() | |
106 | PART.Parent = PARENT | |
107 | Humanoid = Instance.new("Humanoid",char) | |
108 | end | |
109 | end | |
110 | end | |
111 | end | |
112 | char.Humanoid.Died:connect(function() | |
113 | if CanDie == false then | |
114 | refit() | |
115 | end | |
116 | end) | |
117 | ||
118 | player.Chatted:connect(function(msg) | |
119 | if msg:sub(1,5) == "play/" then | |
120 | Sound:Stop() | |
121 | Sound.SoundId = "rbxassetid://" .. msg:sub(6) | |
122 | Sound:Play() | |
123 | Music = market:GetProductInfo(msg:sub(6)) | |
124 | print("Now playing, " .. Music.Name) | |
125 | end | |
126 | if msg == "stop" then | |
127 | Sound:Stop() | |
128 | print("Stopped the music/sound.") | |
129 | end | |
130 | if msg == "antideath on" then | |
131 | CanDie = false | |
132 | print("Antideath has been activated!") | |
133 | end | |
134 | if msg == "antideath off" then | |
135 | CanDie = true | |
136 | print("Oof! Antideath has been deactivated.") | |
137 | end | |
138 | if msg == "loop on" then | |
139 | print("Looping on!") | |
140 | Sound.Looped = true | |
141 | end | |
142 | if msg == "loop off" then | |
143 | print("Looping off!") | |
144 | Sound.Looped = false | |
145 | end | |
146 | end) | |
147 | ||
148 | while rs:wait() do | |
149 | if CanDie == false then | |
150 | refit() | |
151 | end | |
152 | Sound.Parent = Radio | |
153 | 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) | |
154 | end |