View difference between Paste ID: TGnEg1U4 and CWX2s3De
SHOW: | | - or go back to the newest paste.
1
if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
2
local Player,Mouse,mouse,UserInputService,ContextActionService = owner
3
do
4
	print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
5
	script.Parent = Player.Character
6
7
	--RemoteEvent for communicating
8
	local Event = Instance.new("RemoteEvent")
9
	Event.Name = "UserInput_Event"
10
11
	--Fake event to make stuff like Mouse.KeyDown work
12
	local function fakeEvent()
13
		local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
14
		t.connect = t.Connect
15
		return t
16
	end
17
18
	--Creating fake input objects with fake variables
19
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
20
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
21
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
22
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
23
	end}
24
	--Merged 2 functions into one by checking amount of arguments
25
	CAS.UnbindAction = CAS.BindAction
26
27
	--This function will trigger the events that have been :Connect()'ed
28
	local function te(self,ev,...)
29
		local t = m[ev]
30
		if t and t._fakeEvent and t.Function then
31
			t.Function(...)
32
		end
33
	end
34
	m.TrigEvent = te
35
	UIS.TrigEvent = te
36
37
	Event.OnServerEvent:Connect(function(plr,io)
38
	    if plr~=Player then return end
39
		if io.isMouse then
40
			m.Target = io.Target
41
			m.Hit = io.Hit
42
		else
43
			local b = io.UserInputState == Enum.UserInputState.Begin
44
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
45
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
46
			end
47
			for _,t in pairs(CAS.Actions) do
48
				for _,k in pairs(t.Keys) do
49
					if k==io.KeyCode then
50
						t.Function(t.Name,io.UserInputState,io)
51
					end
52
				end
53
			end
54
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
55
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
56
	    end
57
	end)
58
	Event.Parent = NLS([==[
59
	local Player = game:GetService("Players").LocalPlayer
60
	local Event = script:WaitForChild("UserInput_Event")
61
62
	local UIS = game:GetService("UserInputService")
63
	local input = function(io,a)
64
		if a then return end
65
		--Since InputObject is a client-side instance, we create and pass table instead
66
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
67
	end
68
	UIS.InputBegan:Connect(input)
69
	UIS.InputEnded:Connect(input)
70
71
	local Mouse = Player:GetMouse()
72
	local h,t
73
	--Give the server mouse data 30 times every second, but only if the values changed
74
	--If player is not moving their mouse, client won't fire events
75
	while wait(1/30) do
76
		if h~=Mouse.Hit or t~=Mouse.Target then
77
			h,t=Mouse.Hit,Mouse.Target
78
			Event:FireServer({isMouse=true,Target=t,Hit=h})
79
		end
80
	end]==],Player.Character)
81
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
82
end
83
--written by kent911t =D
84
doingwave = false
85
86
FakeHeartbeat=Instance.new('BindableEvent',script)
87
FakeHeartbeat.Name='Heartbeat'
88
script:WaitForChild("Heartbeat")
89
frame = 1/60
90
tf = 0
91
allowframeloss = false
92
tossremainder = false
93
flastframe = tick()
94
script.Heartbeat:Fire()
95
game:GetService("RunService").Heartbeat:connect(function(s, p)
96
  tf = tf + s
97
  if frame <= tf then
98
    if allowframeloss then
99
      script.Heartbeat:Fire()
100
      flastframe = tick()
101
    else
102
      for i = 1, math.floor(tf / frame) do
103
        script.Heartbeat:Fire()
104
      end
105
      flastframe = tick()
106
    end
107
    if tossremainder then
108
      tf = 0
109
    else
110
      tf = tf - frame * math.floor(tf / frame)
111
    end
112
  end
113
end)
114
115
swait = function(t)
116
  if t == nil then
117
    t = 1/60
118
  else
119
    if t == 0 then
120
      t = 1/60
121
    end
122
  end
123
  local s = 0
124
  local stime = tick()
125
  for i_ = 1, t * 60 do
126
    FakeHeartbeat.Event:wait(0)
127
  end
128
  return tick() - stime, workspace.DistributedGameTime
129
end
130
131
local ScreenGui = Instance.new("ScreenGui")
132
local TextBox = Instance.new("TextBox")
133
local TextButton = Instance.new("TextButton")
134
135
ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui
136
137
TextBox.Parent = ScreenGui
138
TextBox.BackgroundColor3 = Color3.new(0.529412, 0.529412, 0.529412)
139
TextBox.Position = UDim2.new(0, 0, 0, 300)
140
TextBox.Size = UDim2.new(0, 200, 0, 50)
141
TextBox.Font = Enum.Font.SciFi
142
TextBox.FontSize = Enum.FontSize.Size14
143
144
TextButton.Parent = TextBox
145
TextButton.BackgroundColor3 = Color3.new(1, 0, 0.0156863)
146
TextButton.Position = UDim2.new(0, 200, 0, 0)
147
TextButton.Size = UDim2.new(0, 50, 0, 50)
148
TextButton.Font = Enum.Font.SciFi
149
TextButton.FontSize = Enum.FontSize.Size14
150
TextButton.Text = "OK"
151
152
-------------------------
153
154
a=Instance.new("Part", game.Players.LocalPlayer.Character)
155
a.Name = "Visualizer"
156
a.Anchored = false
157
a.CanCollide = false
158
a.Size = Vector3.new(0,0,0)
159
a.BrickColor = BrickColor.new("Really red")
160
a.Material = "Neon"
161
a.Transparency = 0.5
162
b = Instance.new("SpecialMesh")
163
b.MeshType = "Sphere"
164
b.Parent = a
165
166
we = Instance.new("Weld")
167
we.Part0 = a
168
we.Part1 = game.Players.LocalPlayer.Character.Torso
169
we.C0 = CFrame.new(-2.5, -3, 5)*CFrame.fromEulerAnglesXYZ(0, -90, 0)
170
we.Parent = a
171
172
c=Instance.new("Part", game.Players.LocalPlayer.Character)
173
c.Name = "Visualizer2"
174
c.Anchored = false
175
c.CanCollide = false
176
c.Size = Vector3.new(0,0,0)
177
c.BrickColor = BrickColor.new("White")
178
c.Material = "Neon"
179
c.Transparency = 0
180
d = Instance.new("SpecialMesh")
181
d.MeshType = "Sphere"
182
d.Parent = c
183
184
we2 = Instance.new("Weld")
185
we2.Part0 = c
186
we2.Part1 = game.Players.LocalPlayer.Character.Torso
187
we2.C0 = CFrame.new(-2.5, -3, 5)*CFrame.fromEulerAnglesXYZ(0, -90, 0)
188
we2.Parent = c
189
190
model2 = Instance.new("Model", game.Players.LocalPlayer.Character)
191
model2.Name = "Rings"
192
193
local ri = Instance.new("Part", model2)
194
	ri.Name = "Wave"
195
	ri.Anchored = true
196
	ri.Transparency = 0
197
	ri.Size = Vector3.new(0, 0, 0)
198
	ri.CanCollide = false
199
	ri.Rotation = Vector3.new(90, 0, 0)
200
	ri.BrickColor = BrickColor.new("Really black")
201
	local mesh4 = Instance.new("SpecialMesh")
202
	mesh4.MeshType = "FileMesh"
203
	mesh4.MeshId = "http://www.roblox.com/asset/?id=3270017"
204
	mesh4.Parent = ri
205
	
206
local ri2 = Instance.new("Part", model2)
207
	ri2.Name = "Wave"
208
	ri2.Anchored = true
209
	ri2.Transparency = 0
210
	ri2.Size = Vector3.new(0, 0, 0)
211
	ri2.CanCollide = false
212
	ri2.Rotation = Vector3.new(90, 0, 0)
213
	ri2.BrickColor = BrickColor.new("Really black")
214
	local mesh5 = Instance.new("SpecialMesh")
215
	mesh5.MeshType = "FileMesh"
216
	mesh5.MeshId = "http://www.roblox.com/asset/?id=3270017"
217
	mesh5.Parent = ri2
218
219
for _, v in pairs(model2:GetChildren()) do
220
	local newPos = Instance.new("BodyPosition") -- making a BodyPosition to put in each ring so that the rings will stay in the right place
221
	newPos.Parent = v
222
	newPos.position = a.Position
223
	newPos.maxForce = Vector3.new(math.huge,math.huge,math.huge)
224
	local newSpin = Instance.new("BodyAngularVelocity") -- this is to make the rings spin
225
	newSpin.Parent = v
226
	local spinPower = 10000
227
	newSpin.maxTorque = Vector3.new(spinPower,spinPower,spinPower)
228
	newSpin.angularvelocity = Vector3.new(math.random(0,200)/100,math.random(0,200)/100,math.random(0,200)/100) -- making thier spin random
229
	v.CFrame = v.CFrame * CFrame.Angles(math.random(1,360),math.random(1,360),math.random(1,360)) -- starting the ring at a random rotation
230
	v.Anchored = false -- unanchoring the ring after it is set up so that it can now spin
231
end
232
233
wave = function()
234
	if doingwave == false then
235
	doingwave = true
236
	local ioe = Instance.new("Part", game.Players.LocalPlayer.Character)
237
	ioe.Name = "Wave"
238
	ioe.Anchored = true
239
	ioe.Transparency = 0
240
	ioe.Size = Vector3.new(0, 0, 0)
241
	ioe.CanCollide = false
242
	ioe.Rotation = Vector3.new(90, 0, 0)
243
	ioe.BrickColor = BrickColor.new("Really black")
244
	local mesh = Instance.new("SpecialMesh")
245
	mesh.MeshType = "FileMesh"
246
	mesh.MeshId = "http://www.roblox.com/asset/?id=3270017"
247
	mesh.Parent = ioe
248
	mesh.Scale = Vector3.new(1.1, 1.1, 1.1)
249
	coroutine.resume(coroutine.create(function()
250
		for i = 1, 10 do
251
			swait()
252
			ioe.Position = a.Position
253
			mesh.Scale = mesh.Scale + Vector3.new(mesh.Scale.x / 3, mesh.Scale.y / 3, 0.5)
254
			ioe.Transparency = ioe.Transparency + 0.01
255
		end
256
		ioe:Destroy()
257
		doingwave = false
258
	end))
259
	else
260
	return
261
	end
262
end
263
264
function onClicked()
265
local id = TextBox.Text
266
if a:FindFirstChild("Sound") then
267
	a.Sound:Destroy()
268
end
269
local sou = Instance.new("Sound", a)
270
sou.Looped = true
271
sou.Pitch = 1
272
sou.Volume = 1
273
sou.SoundId = ("http://www.roblox.com/asset/?id="..id)
274
wait()
275
sou:Play()
276
end 
277
TextButton.MouseButton1Down:connect(onClicked)
278
279
coroutine.resume(coroutine.create(function()
280
	game:GetService("RunService").RenderStepped:connect(function()
281
		if a:FindFirstChild("Sound") ~= nil then
282
		local soundvolume = a.Sound.PlaybackLoudness
283
		b.Scale = Vector3.new(soundvolume / 20, soundvolume / 20, soundvolume / 20)
284
		d.Scale = Vector3.new(soundvolume / 60, soundvolume / 60, soundvolume / 60)
285
		mesh5.Scale = Vector3.new(soundvolume / 120, soundvolume / 120, 0.5)
286
		mesh4.Scale = Vector3.new(soundvolume / 120, soundvolume / 120, 0.5)
287
		ri.Transparency = 0
288
		ri2.Transparency = 0
289
		ri.Position = a.Position
290
		ri2.Position = a.Position
291
		if soundvolume < 150 then
292
			a.BrickColor = BrickColor.new("Black")
293
			c.BrickColor = BrickColor.new("White")
294
		elseif soundvolume >= 500 and soundvolume <= 750 then
295
			a.BrickColor = BrickColor.new("White")
296
			c.BrickColor = BrickColor.new("Black")
297
			wave()
298
			elseif soundvolume > 750 then
299
			a.BrickColor = BrickColor.random()
300
			c.BrickColor = BrickColor.new("White")
301
			elseif soundvolume <= 500 and soundvolume >= 150 then
302
			a.BrickColor = BrickColor.new("Really red")
303
			c.BrickColor = BrickColor.new("White")
304
		end
305
		else
306
			b.Scale = Vector3.new(0.01, 0.01, 0.01)
307
			d.Scale = Vector3.new(0.01, 0.01, 0.01)
308
			ri.Transparency = 1
309
			ri2.Transparency = 1
310
		end
311
	end)
312
end))