SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- This script has been converted to FE by iPxter |
| 1 | + | |
| 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 | ||
| 84 | local player = owner | |
| 85 | local character = player.Character | |
| 86 | local humanoid_root_part = character.HumanoidRootPart | |
| 87 | local market_place_service = game:GetService("MarketplaceService")
| |
| 88 | ||
| 89 | function create_weld(parent, part0, part1, c0, c1) | |
| 90 | local weld = Instance.new("Weld", parent)
| |
| 91 | weld.Part0 = part0 | |
| 92 | weld.Part1 = part1 | |
| 93 | weld.C0 = c0 | |
| 94 | weld.C1 = c1 | |
| 95 | end | |
| 96 | ||
| 97 | local radio = Instance.new("Part", character)
| |
| 98 | radio.Name = "Radio" | |
| 99 | radio.Size = Vector3.new(3.2, 1.6, 1.2) | |
| 100 | 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) | |
| 101 | create_weld(radio, radio, humanoid_root_part, radio.CFrame:inverse(), humanoid_root_part.CFrame:inverse()) | |
| 102 | radio.Orientation = Vector3.new(0, 180, 0) | |
| 103 | local radio_mesh = Instance.new("SpecialMesh", radio)
| |
| 104 | radio_mesh.MeshId = "rbxassetid://212302951" | |
| 105 | radio_mesh.MeshType = Enum.MeshType.FileMesh | |
| 106 | radio_mesh.Offset = Vector3.new(0, 0, 0) | |
| 107 | radio_mesh.Scale = Vector3.new(4, 4, 4) | |
| 108 | radio_mesh.TextureId = "rbxassetid://212303049" | |
| 109 | radio_mesh.VertexColor = Vector3.new(1, 1, 1) | |
| 110 | local sparkles = Instance.new("Sparkles", radio)
| |
| 111 | sparkles.SparkleColor = Color3.fromRGB(255, 255, 0) | |
| 112 | local sound = Instance.new("Sound", radio)
| |
| 113 | sound.Playing = true | |
| 114 | sound.Looped = true | |
| 115 | ||
| 116 | local RadioGui = Instance.new("ScreenGui")
| |
| 117 | local Frame = Instance.new("Frame")
| |
| 118 | local Title = Instance.new("TextLabel")
| |
| 119 | local PlayButton = Instance.new("TextButton")
| |
| 120 | local PauseButton = Instance.new("TextButton")
| |
| 121 | local StopButton = Instance.new("TextButton")
| |
| 122 | local SoundID = Instance.new("TextBox")
| |
| 123 | ||
| 124 | RadioGui.Name = "RadioGui" | |
| 125 | RadioGui.Parent = owner:WaitForChild("PlayerGui")
| |
| 126 | RadioGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling | |
| 127 | ||
| 128 | Frame.Parent = RadioGui | |
| 129 | Frame.BackgroundColor3 = Color3.new(1, 1, 1) | |
| 130 | Frame.BorderColor3 = Color3.new(0, 0, 0) | |
| 131 | Frame.BorderSizePixel = 0 | |
| 132 | Frame.Position = UDim2.new(0.00642201817, 0, 0.61403507, 0) | |
| 133 | Frame.Size = UDim2.new(0.343119264, 0, 0.369005859, 0) | |
| 134 | ||
| 135 | Title.Name = "Title" | |
| 136 | Title.Parent = Frame | |
| 137 | Title.BackgroundColor3 = Color3.new(1, 1, 1) | |
| 138 | Title.BackgroundTransparency = 1 | |
| 139 | Title.BorderColor3 = Color3.new(0, 0, 0) | |
| 140 | Title.BorderSizePixel = 0 | |
| 141 | Title.Selectable = true | |
| 142 | Title.Size = UDim2.new(1, 0, 0.205652446, 0) | |
| 143 | Title.Font = Enum.Font.SourceSans | |
| 144 | Title.Text = "Radio GUI" | |
| 145 | Title.TextColor3 = Color3.new(0, 0, 0) | |
| 146 | Title.TextScaled = true | |
| 147 | Title.TextSize = 14 | |
| 148 | Title.TextWrapped = true | |
| 149 | ||
| 150 | PlayButton.Name = "PlayButton" | |
| 151 | PlayButton.Parent = Frame | |
| 152 | PlayButton.BackgroundColor3 = Color3.new(0.333333, 1, 0) | |
| 153 | PlayButton.BorderColor3 = Color3.new(0, 0, 0) | |
| 154 | PlayButton.BorderSizePixel = 0 | |
| 155 | PlayButton.Position = UDim2.new(0, 0, 0.734284222, 0) | |
| 156 | PlayButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0) | |
| 157 | PlayButton.Font = Enum.Font.SourceSans | |
| 158 | PlayButton.Text = "PLAY" | |
| 159 | PlayButton.TextColor3 = Color3.new(1, 1, 1) | |
| 160 | PlayButton.TextScaled = true | |
| 161 | PlayButton.TextSize = 14 | |
| 162 | PlayButton.TextWrapped = true | |
| 163 | ||
| 164 | PauseButton.Name = "PauseButton" | |
| 165 | PauseButton.Parent = Frame | |
| 166 | PauseButton.BackgroundColor3 = Color3.new(1, 0.666667, 0) | |
| 167 | PauseButton.BorderColor3 = Color3.new(0, 0, 0) | |
| 168 | PauseButton.BorderSizePixel = 0 | |
| 169 | PauseButton.Position = UDim2.new(0.334224582, 0, 0.734284222, 0) | |
| 170 | PauseButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0) | |
| 171 | PauseButton.Font = Enum.Font.SourceSans | |
| 172 | PauseButton.Text = "PAUSE" | |
| 173 | PauseButton.TextColor3 = Color3.new(1, 1, 1) | |
| 174 | PauseButton.TextScaled = true | |
| 175 | PauseButton.TextSize = 14 | |
| 176 | PauseButton.TextWrapped = true | |
| 177 | ||
| 178 | StopButton.Name = "StopButton" | |
| 179 | StopButton.Parent = Frame | |
| 180 | StopButton.BackgroundColor3 = Color3.new(1, 0, 0) | |
| 181 | StopButton.BorderColor3 = Color3.new(0, 0, 0) | |
| 182 | StopButton.BorderSizePixel = 0 | |
| 183 | StopButton.Position = UDim2.new(0.671122968, 0, 0.734284222, 0) | |
| 184 | StopButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0) | |
| 185 | StopButton.Font = Enum.Font.SourceSans | |
| 186 | StopButton.Text = "STOP" | |
| 187 | StopButton.TextColor3 = Color3.new(1, 1, 1) | |
| 188 | StopButton.TextScaled = true | |
| 189 | StopButton.TextSize = 14 | |
| 190 | StopButton.TextWrapped = true | |
| 191 | ||
| 192 | SoundID.Name = "SoundID" | |
| 193 | SoundID.Parent = Frame | |
| 194 | SoundID.BackgroundColor3 = Color3.new(0.333333, 0.666667, 1) | |
| 195 | SoundID.BorderColor3 = Color3.new(0, 0, 0) | |
| 196 | SoundID.BorderSizePixel = 3 | |
| 197 | SoundID.Position = UDim2.new(0.213903725, 0, 0.364500791, 0) | |
| 198 | SoundID.Size = UDim2.new(0.566310227, 0, 0.269043893, 0) | |
| 199 | SoundID.Font = Enum.Font.SourceSans | |
| 200 | SoundID.PlaceholderColor3 = Color3.new(1, 1, 1) | |
| 201 | SoundID.PlaceholderText = "Sound ID" | |
| 202 | SoundID.Text = "" | |
| 203 | SoundID.TextColor3 = Color3.new(1, 1, 1) | |
| 204 | SoundID.TextScaled = true | |
| 205 | SoundID.TextSize = 14 | |
| 206 | SoundID.TextWrapped = true | |
| 207 | ||
| 208 | local radio_billboard_gui = Instance.new("BillboardGui", character.Head)
| |
| 209 | radio_billboard_gui.Name = "RadioBillboardGUI" | |
| 210 | radio_billboard_gui.Adornee = character.Head | |
| 211 | radio_billboard_gui.AlwaysOnTop = true | |
| 212 | radio_billboard_gui.ExtentsOffsetWorldSpace = Vector3.new(0, 9, 0) | |
| 213 | radio_billboard_gui.Size = UDim2.new(8, 0, 6, 0) | |
| 214 | local radio_billboard_gui_textlabel = Instance.new("TextLabel", radio_billboard_gui)
| |
| 215 | radio_billboard_gui_textlabel.BackgroundTransparency = 1 | |
| 216 | radio_billboard_gui_textlabel.BorderColor3 = Color3.fromRGB(0, 0, 0) | |
| 217 | radio_billboard_gui_textlabel.BorderSizePixel = 0 | |
| 218 | radio_billboard_gui_textlabel.Size = UDim2.new(1, 0, 1, 0) | |
| 219 | radio_billboard_gui_textlabel.Text = "Right now playing: " | |
| 220 | radio_billboard_gui_textlabel.TextColor3 = Color3.fromRGB(0, 0, 0) | |
| 221 | radio_billboard_gui_textlabel.TextSize = 18 | |
| 222 | radio_billboard_gui_textlabel.TextWrapped = true | |
| 223 | ||
| 224 | function zigzag(x) | |
| 225 | return math.acos(math.cos(x * math.pi)) / math.pi | |
| 226 | end | |
| 227 | ||
| 228 | PlayButton.MouseButton1Click:Connect(function() | |
| 229 | if sound.IsPaused == true then | |
| 230 | sound:Resume() | |
| 231 | else | |
| 232 | sound.SoundId = "rbxassetid://"..tonumber(SoundID.Text) | |
| 233 | sound:Play() | |
| 234 | local info = market_place_service:GetProductInfo(tonumber(SoundID.Text)) | |
| 235 | radio_billboard_gui_textlabel.Text = "Right now playing: "..info.Name | |
| 236 | end | |
| 237 | end) | |
| 238 | ||
| 239 | PauseButton.MouseButton1Click:Connect(function() | |
| 240 | sound:Pause() | |
| 241 | end) | |
| 242 | ||
| 243 | StopButton.MouseButton1Click:Connect(function() | |
| 244 | sound:Stop() | |
| 245 | end) | |
| 246 | ||
| 247 | local while_wait_do1 = coroutine.create(function() | |
| 248 | local counter = 0 | |
| 249 | while wait(0.1) do | |
| 250 | Frame.BackgroundColor3 = Color3.fromHSV(zigzag(counter), 1, 1) | |
| 251 | counter = counter + 0.01 | |
| 252 | end | |
| 253 | end) | |
| 254 | coroutine.resume(while_wait_do1) | |
| 255 | ||
| 256 | local while_wait_do2 = coroutine.create(function() | |
| 257 | local counter = 0 | |
| 258 | while wait(0.1) do | |
| 259 | radio_billboard_gui_textlabel.TextColor3 = Color3.fromHSV(zigzag(counter), 1, 1) | |
| 260 | counter = counter + 0.01 | |
| 261 | end | |
| 262 | end) | |
| 263 | coroutine.resume(while_wait_do2) | |
| 264 | ||
| 265 | local while_wait_do3 = coroutine.create(function() | |
| 266 | while true do | |
| 267 | wait(0.005) | |
| 268 | radio_billboard_gui_textlabel.Rotation = radio_billboard_gui_textlabel.Rotation + 0.07 | |
| 269 | end | |
| 270 | end) | |
| 271 | coroutine.resume(while_wait_do3) |