View difference between Paste ID: K64D18w6 and T3F0bQMT
SHOW: | | - or go back to the newest paste.
1-
local player = game.Players.LocalPlayer
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
21
	--Creating fake input objects with fake variables
22
    local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
23
	local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
24
	local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
25
		CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
26
	end}
27
	--Merged 2 functions into one by checking amount of arguments
28
	CAS.UnbindAction = CAS.BindAction
29
30
	--This function will trigger the events that have been :Connect()'ed
31
	local function te(self,ev,...)
32
		local t = m[ev]
33
		if t and t._fakeEvent and t.Function then
34
			t.Function(...)
35
		end
36
	end
37
	m.TrigEvent = te
38
	UIS.TrigEvent = te
39
40
	Event.OnServerEvent:Connect(function(plr,io)
41
	    if plr~=Player then return end
42-
RadioGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
42+
		if io.isMouse then
43
			m.Target = io.Target
44
			m.Hit = io.Hit
45
		else
46
			local b = io.UserInputState == Enum.UserInputState.Begin
47
			if io.UserInputType == Enum.UserInputType.MouseButton1 then
48
				return m:TrigEvent(b and "Button1Down" or "Button1Up")
49
			end
50
			for _,t in pairs(CAS.Actions) do
51
				for _,k in pairs(t.Keys) do
52
					if k==io.KeyCode then
53
						t.Function(t.Name,io.UserInputState,io)
54
					end
55
				end
56
			end
57
			m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
58
			UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
59
	    end
60
	end)
61
	Event.Parent = NLS([==[
62
	local Player = game:GetService("Players").LocalPlayer
63
	local Event = script:WaitForChild("UserInput_Event")
64
65
	local UIS = game:GetService("UserInputService")
66
	local input = function(io,a)
67
		if a then return end
68
		--Since InputObject is a client-side instance, we create and pass table instead
69
		Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
70
	end
71
	UIS.InputBegan:Connect(input)
72
	UIS.InputEnded:Connect(input)
73
74
	local Mouse = Player:GetMouse()
75
	local h,t
76
	--Give the server mouse data 30 times every second, but only if the values changed
77
	--If player is not moving their mouse, client won't fire events
78
	while wait(1/30) do
79
		if h~=Mouse.Hit or t~=Mouse.Target then
80
			h,t=Mouse.Hit,Mouse.Target
81
			Event:FireServer({isMouse=true,Target=t,Hit=h})
82
		end
83
	end]==],Player.Character)
84
	Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
85
end
86
87
local player = owner
88
local character = player.Character
89
local humanoid_root_part = character.HumanoidRootPart
90
local market_place_service = game:GetService("MarketplaceService")
91
92
function create_weld(parent, part0, part1, c0, c1)
93
	local weld = Instance.new("Weld", parent)
94
	weld.Part0 = part0
95
	weld.Part1 = part1
96
	weld.C0 = c0
97
	weld.C1 = c1
98
end
99
100
local radio = Instance.new("Part", character)
101
radio.Name = "Radio"
102
radio.Size = Vector3.new(3.2, 1.6, 1.2)
103
radio.CFrame = CFrame.new(humanoid_root_part.CFrame.X + (-0.101), humanoid_root_part.CFrame.Y + 0.23, humanoid_root_part.CFrame.Z + 0.801)
104
create_weld(radio, radio, humanoid_root_part, radio.CFrame:inverse(), humanoid_root_part.CFrame:inverse())
105
radio.Orientation = Vector3.new(0, 180, 0)
106
local radio_mesh = Instance.new("SpecialMesh", radio)
107
radio_mesh.MeshId = "rbxassetid://212302951"
108
radio_mesh.MeshType = Enum.MeshType.FileMesh
109
radio_mesh.Offset = Vector3.new(0, 0, 0)
110
radio_mesh.Scale = Vector3.new(4, 4, 4)
111
radio_mesh.TextureId = "rbxassetid://212303049"
112
radio_mesh.VertexColor = Vector3.new(1, 1, 1)
113
local sparkles = Instance.new("Sparkles", radio)
114
sparkles.SparkleColor = Color3.fromRGB(255, 255, 0)
115
local sound = Instance.new("Sound", radio)
116
sound.Playing = true
117
sound.Looped = true
118
119
local RadioGui = Instance.new("ScreenGui")
120
local Frame = Instance.new("Frame")
121
local Title = Instance.new("TextLabel")
122
local PlayButton = Instance.new("TextButton")
123
local PauseButton = Instance.new("TextButton")
124
local StopButton = Instance.new("TextButton")
125
local SoundID = Instance.new("TextBox")
126
127
RadioGui.Name = "RadioGui"
128
RadioGui.Parent = owner:WaitForChild("PlayerGui")
129
RadioGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
130
131
Frame.Parent = RadioGui
132
Frame.BackgroundColor3 = Color3.new(1, 1, 1)
133
Frame.BorderColor3 = Color3.new(0, 0, 0)
134
Frame.BorderSizePixel = 0
135
Frame.Position = UDim2.new(0.00642201817, 0, 0.61403507, 0)
136
Frame.Size = UDim2.new(0.343119264, 0, 0.369005859, 0)
137
138
Title.Name = "Title"
139
Title.Parent = Frame
140
Title.BackgroundColor3 = Color3.new(1, 1, 1)
141
Title.BackgroundTransparency = 1
142
Title.BorderColor3 = Color3.new(0, 0, 0)
143
Title.BorderSizePixel = 0
144
Title.Selectable = true
145
Title.Size = UDim2.new(1, 0, 0.205652446, 0)
146
Title.Font = Enum.Font.SourceSans
147
Title.Text = "Radio GUI"
148
Title.TextColor3 = Color3.new(0, 0, 0)
149
Title.TextScaled = true
150
Title.TextSize = 14
151
Title.TextWrapped = true
152
153
PlayButton.Name = "PlayButton"
154
PlayButton.Parent = Frame
155
PlayButton.BackgroundColor3 = Color3.new(0.333333, 1, 0)
156
PlayButton.BorderColor3 = Color3.new(0, 0, 0)
157
PlayButton.BorderSizePixel = 0
158
PlayButton.Position = UDim2.new(0, 0, 0.734284222, 0)
159
PlayButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0)
160
PlayButton.Font = Enum.Font.SourceSans
161
PlayButton.Text = "PLAY"
162
PlayButton.TextColor3 = Color3.new(1, 1, 1)
163
PlayButton.TextScaled = true
164
PlayButton.TextSize = 14
165
PlayButton.TextWrapped = true
166
167
PauseButton.Name = "PauseButton"
168
PauseButton.Parent = Frame
169
PauseButton.BackgroundColor3 = Color3.new(1, 0.666667, 0)
170
PauseButton.BorderColor3 = Color3.new(0, 0, 0)
171
PauseButton.BorderSizePixel = 0
172
PauseButton.Position = UDim2.new(0.334224582, 0, 0.734284222, 0)
173
PauseButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0)
174
PauseButton.Font = Enum.Font.SourceSans
175
PauseButton.Text = "PAUSE"
176
PauseButton.TextColor3 = Color3.new(1, 1, 1)
177
PauseButton.TextScaled = true
178
PauseButton.TextSize = 14
179
PauseButton.TextWrapped = true
180
181
StopButton.Name = "StopButton"
182
StopButton.Parent = Frame
183
StopButton.BackgroundColor3 = Color3.new(1, 0, 0)
184
StopButton.BorderColor3 = Color3.new(0, 0, 0)
185
StopButton.BorderSizePixel = 0
186
StopButton.Position = UDim2.new(0.671122968, 0, 0.734284222, 0)
187
StopButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0)
188
StopButton.Font = Enum.Font.SourceSans
189
StopButton.Text = "STOP"
190
StopButton.TextColor3 = Color3.new(1, 1, 1)
191
StopButton.TextScaled = true
192
StopButton.TextSize = 14
193
StopButton.TextWrapped = true
194
195
SoundID.Name = "SoundID"
196
SoundID.Parent = Frame
197
SoundID.BackgroundColor3 = Color3.new(0.333333, 0.666667, 1)
198
SoundID.BorderColor3 = Color3.new(0, 0, 0)
199
SoundID.BorderSizePixel = 3
200
SoundID.Position = UDim2.new(0.213903725, 0, 0.364500791, 0)
201
SoundID.Size = UDim2.new(0.566310227, 0, 0.269043893, 0)
202
SoundID.Font = Enum.Font.SourceSans
203
SoundID.PlaceholderColor3 = Color3.new(1, 1, 1)
204
SoundID.PlaceholderText = "Sound ID"
205
SoundID.Text = ""
206
SoundID.TextColor3 = Color3.new(1, 1, 1)
207
SoundID.TextScaled = true
208
SoundID.TextSize = 14
209
SoundID.TextWrapped = true
210
211
local radio_billboard_gui = Instance.new("BillboardGui", character.Head)
212
radio_billboard_gui.Name = "RadioBillboardGUI"
213
radio_billboard_gui.Adornee = character.Head
214
radio_billboard_gui.AlwaysOnTop = true
215
radio_billboard_gui.ExtentsOffsetWorldSpace = Vector3.new(0, 9, 0)
216
radio_billboard_gui.Size = UDim2.new(8, 0, 6, 0)
217
local radio_billboard_gui_textlabel = Instance.new("TextLabel", radio_billboard_gui)
218
radio_billboard_gui_textlabel.BackgroundTransparency = 1
219
radio_billboard_gui_textlabel.BorderColor3 = Color3.fromRGB(0, 0, 0)
220
radio_billboard_gui_textlabel.BorderSizePixel = 0
221
radio_billboard_gui_textlabel.Size = UDim2.new(1, 0, 1, 0)
222
radio_billboard_gui_textlabel.Text = "Right now playing: "
223
radio_billboard_gui_textlabel.TextColor3 = Color3.fromRGB(0, 0, 0)
224
radio_billboard_gui_textlabel.TextSize = 18
225
radio_billboard_gui_textlabel.TextWrapped = true
226
227
function zigzag(x)
228
	return math.acos(math.cos(x * math.pi)) / math.pi
229
end
230
	
231
PlayButton.MouseButton1Click:Connect(function()
232
	if sound.IsPaused == true then
233
		sound:Resume()
234
	else
235
		sound.SoundId = "rbxassetid://"..tonumber(SoundID.Text)
236
		sound:Play()
237
		local info = market_place_service:GetProductInfo(tonumber(SoundID.Text))
238
		radio_billboard_gui_textlabel.Text = "Right now playing: "..info.Name
239
	end
240
end)
241
	
242
PauseButton.MouseButton1Click:Connect(function()
243
	sound:Pause()
244
end)
245
246
StopButton.MouseButton1Click:Connect(function()
247
	sound:Stop()
248
end)
249
250
local while_wait_do1 = coroutine.create(function()
251
	local counter = 0
252
	while wait(0.1) do
253
		Frame.BackgroundColor3 = Color3.fromHSV(zigzag(counter), 1, 1)
254
		counter = counter + 0.01
255
	end
256
end)
257
coroutine.resume(while_wait_do1)
258
259
local while_wait_do2 = coroutine.create(function()
260
	local counter = 0
261
	while wait(0.1) do
262
		radio_billboard_gui_textlabel.TextColor3 = Color3.fromHSV(zigzag(counter), 1, 1)
263
		counter = counter + 0.01
264
	end
265
end)
266
coroutine.resume(while_wait_do2)
267
268
local while_wait_do3 = coroutine.create(function()
269
	while true do
270
		wait(0.005)
271
		radio_billboard_gui_textlabel.Rotation = radio_billboard_gui_textlabel.Rotation + 0.07
272
	end
273
end)
274
coroutine.resume(while_wait_do3)