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
|
| 1 | + | if game:GetService("RunService"):IsClient()then error("say h/ not hl/ ya dummy")end;print("get rekt");InternalData = {}
|
| 2 | - | local Player,Mouse,mouse,UserInputService,ContextActionService = owner |
| 2 | + | |
| 3 | script.Parent = owner.Character | |
| 4 | - | print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
|
| 4 | + | local Event = Instance.new("RemoteEvent");Event.Name = "UserInput"
|
| 5 | - | script.Parent = Player.Character |
| 5 | + | local function NewFakeEvent() |
| 6 | local Bind = Instance.new("BindableEvent")
| |
| 7 | - | --RemoteEvent for communicating |
| 7 | + | local Fake;Fake = {Connections = {},
|
| 8 | - | local Event = Instance.new("RemoteEvent")
|
| 8 | + | fakeEvent=true; |
| 9 | - | Event.Name = "UserInput_Event" |
| 9 | + | Connect=function(self,Func) |
| 10 | Bind.Event:connect(Func) | |
| 11 | - | --Fake event to make stuff like Mouse.KeyDown work |
| 11 | + | self.Connections[Bind] = true |
| 12 | - | local function fakeEvent() |
| 12 | + | return setmetatable({Connected = true},{
|
| 13 | - | local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
|
| 13 | + | __index = function (self,Index) |
| 14 | - | t.connect = t.Connect |
| 14 | + | if Index:lower() == "disconnect" then |
| 15 | - | return t |
| 15 | + | return function() Fake.Connections[Bind] = false;self.Connected = false end |
| 16 | end | |
| 17 | return Fake[Index] | |
| 18 | - | --Creating fake input objects with fake variables |
| 18 | + | end; |
| 19 | - | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
|
| 19 | + | __tostring = function() return "Connection" end; |
| 20 | - | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
|
| 20 | + | }) |
| 21 | - | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
|
| 21 | + | end} |
| 22 | - | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
|
| 22 | + | Fake.connect = Fake.Connect;return Fake; |
| 23 | - | end} |
| 23 | + | end |
| 24 | - | --Merged 2 functions into one by checking amount of arguments |
| 24 | + | local Mouse = {Target=nil,Hit=CFrame.new(),KeyUp=NewFakeEvent(),KeyDown=NewFakeEvent(),Button1Up=NewFakeEvent(),Button1Down=NewFakeEvent()}
|
| 25 | - | CAS.UnbindAction = CAS.BindAction |
| 25 | + | local UserInputService = {InputBegan=NewFakeEvent(),InputEnded=NewFakeEvent()}
|
| 26 | local ContextActionService = {Actions={},BindAction = function(self,actionName,Func,touch,...)
| |
| 27 | - | --This function will trigger the events that have been :Connect()'ed |
| 27 | + | self.Actions[actionName] = Func and {Name=actionName,Function=Func,Keys={...}} or nil
|
| 28 | - | local function te(self,ev,...) |
| 28 | + | end};ContextActionService.UnBindAction = ContextActionService.BindAction |
| 29 | - | local t = m[ev] |
| 29 | + | local function TriggerEvent(self,Event,...) |
| 30 | - | if t and t._fakeEvent and t.Function then |
| 30 | + | local Trigger = Mouse[Event] |
| 31 | - | t.Function(...) |
| 31 | + | if Trigger and Trigger.fakeEvent and Trigger.Connections then |
| 32 | - | end |
| 32 | + | for Connection,Active in pairs(Trigger.Connections) do if Active then Connection:Fire(...) end end |
| 33 | end | |
| 34 | - | m.TrigEvent = te |
| 34 | + | end |
| 35 | - | UIS.TrigEvent = te |
| 35 | + | Mouse.TrigEvent = TriggerEvent;UserInputService.TrigEvent = TriggerEvent |
| 36 | Event.OnServerEvent:Connect(function(FiredBy,Input) | |
| 37 | - | Event.OnServerEvent:Connect(function(plr,io) |
| 37 | + | if FiredBy.Name ~= owner.Name then return end |
| 38 | - | if plr~=Player then return end |
| 38 | + | if Input.MouseEvent then |
| 39 | - | if io.isMouse then |
| 39 | + | Mouse.Target = Input.Target;Mouse.Hit = Input.Hit |
| 40 | - | m.Target = io.Target |
| 40 | + | else |
| 41 | - | m.Hit = io.Hit |
| 41 | + | local Begin = Input.UserInputState == Enum.UserInputState.Begin |
| 42 | - | else |
| 42 | + | if Input.UserInputType == Enum.UserInputType.MouseButton1 then return Mouse:TrigEvent(Begin and "Button1Down" or "Button1Up") end |
| 43 | - | local b = io.UserInputState == Enum.UserInputState.Begin |
| 43 | + | for _,Action in pairs(ContextActionService.Actions) do |
| 44 | - | if io.UserInputType == Enum.UserInputType.MouseButton1 then |
| 44 | + | for _,Key in pairs(Action.Keys) do if Key==Input.KeyCode then Action.Function(Action.Name,Input.UserInputState,Input) end end |
| 45 | - | return m:TrigEvent(b and "Button1Down" or "Button1Up") |
| 45 | + | end |
| 46 | - | end |
| 46 | + | Mouse:TrigEvent(Begin and "KeyDown" or "KeyUp",Input.KeyCode.Name:lower()) |
| 47 | - | for _,t in pairs(CAS.Actions) do |
| 47 | + | UserInputService:TrigEvent(Begin and "InputBegan" or "InputEnded",Input,false) |
| 48 | - | for _,k in pairs(t.Keys) do |
| 48 | + | end |
| 49 | - | if k==io.KeyCode then |
| 49 | + | end) |
| 50 | - | t.Function(t.Name,io.UserInputState,io) |
| 50 | + | InternalData["Mouse"] = Mouse;InternalData["ContextActionService"] = ContextActionService;InternalData["UserInputService"] = UserInputService |
| 51 | - | end |
| 51 | + | Event.Parent = NLS([[ |
| 52 | - | end |
| 52 | + | local Player = owner;local Event = script:WaitForChild("UserInput");local UserInputService = game:GetService("UserInputService");local Mouse = Player:GetMouse()
|
| 53 | - | end |
| 53 | + | local Input = function(Input,gameProcessedEvent) |
| 54 | - | m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower()) |
| 54 | + | if gameProcessedEvent then return end |
| 55 | - | UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false) |
| 55 | + | Event:FireServer({KeyCode=Input.KeyCode,UserInputType=Input.UserInputType,UserInputState=Input.UserInputState})
|
| 56 | - | end |
| 56 | + | end |
| 57 | - | end) |
| 57 | + | UserInputService.InputBegan:Connect(Input);UserInputService.InputEnded:Connect(Input) |
| 58 | - | Event.Parent = NLS([==[ |
| 58 | + | local Hit,Target |
| 59 | - | local Player = game:GetService("Players").LocalPlayer
|
| 59 | + | while wait(1/30) do |
| 60 | - | local Event = script:WaitForChild("UserInput_Event")
|
| 60 | + | if Hit ~= Mouse.Hit or Target ~= Mouse.Target then |
| 61 | Hit,Target = Mouse.Hit,Mouse.Target;Event:FireServer({["MouseEvent"]=true,["Target"]=Target,["Hit"]=Hit})
| |
| 62 | - | local UIS = game:GetService("UserInputService")
|
| 62 | + | end |
| 63 | - | local input = function(io,a) |
| 63 | + | end |
| 64 | - | if a then return end |
| 64 | + | ]],owner.Character) |
| 65 | - | --Since InputObject is a client-side instance, we create and pass table instead |
| 65 | + | |
| 66 | - | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
|
| 66 | + | RealGame = game;game = setmetatable({},{
|
| 67 | __index = function (self,Index) | |
| 68 | - | UIS.InputBegan:Connect(input) |
| 68 | + | local Sandbox = function (Thing) |
| 69 | - | UIS.InputEnded:Connect(input) |
| 69 | + | if Thing:IsA("Player") then
|
| 70 | local RealPlayer = Thing | |
| 71 | - | local Mouse = Player:GetMouse() |
| 71 | + | return setmetatable({},{
|
| 72 | - | local h,t |
| 72 | + | __index = function (self,Index) |
| 73 | - | --Give the server mouse data 30 times every second, but only if the values changed |
| 73 | + | local Type = type(RealPlayer[Index]) |
| 74 | - | --If player is not moving their mouse, client won't fire events |
| 74 | + | if Type == "function" then |
| 75 | - | while wait(1/30) do |
| 75 | + | if Index:lower() == "getmouse" or Index:lower() == "mouse" then |
| 76 | - | if h~=Mouse.Hit or t~=Mouse.Target then |
| 76 | + | return function (self)return InternalData["Mouse"] end |
| 77 | - | h,t=Mouse.Hit,Mouse.Target |
| 77 | + | end |
| 78 | - | Event:FireServer({isMouse=true,Target=t,Hit=h})
|
| 78 | + | return function (self,...)return RealPlayer[Index](RealPlayer,...) end |
| 79 | - | end |
| 79 | + | end |
| 80 | - | end]==],Player.Character) |
| 80 | + | return RealPlayer[Index] |
| 81 | - | Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS |
| 81 | + | end; |
| 82 | __tostring = function(self) return RealPlayer.Name end | |
| 83 | }) | |
| 84 | end | |
| 85 | end | |
| 86 | if RealGame[Index] then | |
| 87 | local Type = type(RealGame[Index]) | |
| 88 | if Type == "function" then | |
| 89 | if Index:lower() == "getservice" or Index:lower() == "service" then | |
| 90 | return function (self,Service) | |
| 91 | local FakeServices = {
| |
| 92 | ["players"] = function() | |
| 93 | return setmetatable({},{
| |
| 94 | __index = function (self2,Index2) | |
| 95 | local RealService = RealGame:GetService(Service) | |
| 96 | local Type2 = type(Index2) | |
| 97 | if Type2 == "function" then | |
| 98 | return function (self,...) return RealService[Index2](RealService,...)end | |
| 99 | else | |
| 100 | if Index2:lower() == "localplayer" then return Sandbox(owner) end | |
| 101 | return RealService[Index2] | |
| 102 | end | |
| 103 | end; | |
| 104 | __tostring = function(self) return RealGame:GetService(Service).Name end | |
| 105 | }) | |
| 106 | end; | |
| 107 | ["contextactionservice"] = function() return InternalData["ContextActionService"] end; | |
| 108 | ["userinputservice"] = function() return InternalData["UserInputService"] end; | |
| 109 | ["runservice"] = function() | |
| 110 | return setmetatable({},{
| |
| 111 | __index = function(self2,Index2) | |
| 112 | local RealService = RealGame:GetService(Service) | |
| 113 | local Type2 = type(Index2) | |
| 114 | if Type2 == "function" then | |
| 115 | return function (self,...) return RealService[Index2](RealService,...) end | |
| 116 | else | |
| 117 | local RunServices = {
| |
| 118 | ["bindtorenderstep"] = function() return function (self,Name,Priority,Function) return RealGame:GetService("RunService").Stepped:Connect(Function) end end;
| |
| 119 | ["renderstepped"] = function() return RealService["Stepped"] end | |
| 120 | } | |
| 121 | if RunServices[Index2:lower()] then return RunServices[Index2:lower()]() end | |
| 122 | return RealService[Index2] | |
| 123 | end | |
| 124 | end | |
| 125 | }) | |
| 126 | end | |
| 127 | } | |
| 128 | if FakeServices[Service:lower()] then return FakeServices[Service:lower()]() end | |
| 129 | return RealGame:GetService(Service) | |
| 130 | end | |
| 131 | end | |
| 132 | return function (self,...) return RealGame[Index](RealGame,...) end | |
| 133 | else | |
| 134 | if game:GetService(Index) then return game:GetService(Index) end | |
| 135 | return RealGame[Index] | |
| 136 | end | |
| 137 | end | |
| 138 | return nil | |
| 139 | end | |
| 140 | });Game = game;owner = game:GetService("Players").LocalPlayer;script = Instance.new("Script");print("running the script noob")
| |
| 141 | ||
| 142 | local player = owner | |
| 143 | local character = player.Character | |
| 144 | local humanoid_root_part = character.HumanoidRootPart | |
| 145 | local market_place_service = game:GetService("MarketplaceService")
| |
| 146 | ||
| 147 | function create_weld(parent, part0, part1, c0, c1) | |
| 148 | local weld = Instance.new("Weld", parent)
| |
| 149 | weld.Part0 = part0 | |
| 150 | weld.Part1 = part1 | |
| 151 | weld.C0 = c0 | |
| 152 | weld.C1 = c1 | |
| 153 | end | |
| 154 | ||
| 155 | local radio = Instance.new("Part", character)
| |
| 156 | radio.Name = "Radio" | |
| 157 | radio.Size = Vector3.new(3.2, 1.6, 1.2) | |
| 158 | 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) | |
| 159 | create_weld(radio, radio, humanoid_root_part, radio.CFrame:inverse(), humanoid_root_part.CFrame:inverse()) | |
| 160 | radio.Orientation = Vector3.new(0, 180, 0) | |
| 161 | local radio_mesh = Instance.new("SpecialMesh", radio)
| |
| 162 | radio_mesh.MeshId = "rbxassetid://212302951" | |
| 163 | radio_mesh.MeshType = Enum.MeshType.FileMesh | |
| 164 | radio_mesh.Offset = Vector3.new(0, 0, 0) | |
| 165 | radio_mesh.Scale = Vector3.new(4, 4, 4) | |
| 166 | radio_mesh.TextureId = "rbxassetid://212303049" | |
| 167 | radio_mesh.VertexColor = Vector3.new(1, 1, 1) | |
| 168 | local sparkles = Instance.new("Sparkles", radio)
| |
| 169 | sparkles.SparkleColor = Color3.fromRGB(255, 255, 0) | |
| 170 | local sound = Instance.new("Sound", radio)
| |
| 171 | sound.Playing = true | |
| 172 | sound.Looped = true | |
| 173 | ||
| 174 | local RadioGui = Instance.new("ScreenGui")
| |
| 175 | local Frame = Instance.new("Frame")
| |
| 176 | local Title = Instance.new("TextLabel")
| |
| 177 | local PlayButton = Instance.new("TextButton")
| |
| 178 | local PauseButton = Instance.new("TextButton")
| |
| 179 | local StopButton = Instance.new("TextButton")
| |
| 180 | local SoundID = Instance.new("TextBox")
| |
| 181 | ||
| 182 | RadioGui.Name = "RadioGui" | |
| 183 | RadioGui.Parent = owner:WaitForChild("PlayerGui")
| |
| 184 | RadioGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling | |
| 185 | ||
| 186 | Frame.Parent = RadioGui | |
| 187 | Frame.BackgroundColor3 = Color3.new(1, 1, 1) | |
| 188 | Frame.BorderColor3 = Color3.new(0, 0, 0) | |
| 189 | Frame.BorderSizePixel = 0 | |
| 190 | Frame.Position = UDim2.new(0.00642201817, 0, 0.61403507, 0) | |
| 191 | Frame.Size = UDim2.new(0.343119264, 0, 0.369005859, 0) | |
| 192 | ||
| 193 | Title.Name = "Title" | |
| 194 | Title.Parent = Frame | |
| 195 | Title.BackgroundColor3 = Color3.new(1, 1, 1) | |
| 196 | Title.BackgroundTransparency = 1 | |
| 197 | Title.BorderColor3 = Color3.new(0, 0, 0) | |
| 198 | Title.BorderSizePixel = 0 | |
| 199 | Title.Selectable = true | |
| 200 | Title.Size = UDim2.new(1, 0, 0.205652446, 0) | |
| 201 | Title.Font = Enum.Font.SourceSans | |
| 202 | Title.Text = "Radio GUI" | |
| 203 | Title.TextColor3 = Color3.new(0, 0, 0) | |
| 204 | Title.TextScaled = true | |
| 205 | Title.TextSize = 14 | |
| 206 | Title.TextWrapped = true | |
| 207 | ||
| 208 | PlayButton.Name = "PlayButton" | |
| 209 | PlayButton.Parent = Frame | |
| 210 | PlayButton.BackgroundColor3 = Color3.new(0.333333, 1, 0) | |
| 211 | PlayButton.BorderColor3 = Color3.new(0, 0, 0) | |
| 212 | PlayButton.BorderSizePixel = 0 | |
| 213 | PlayButton.Position = UDim2.new(0, 0, 0.734284222, 0) | |
| 214 | PlayButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0) | |
| 215 | PlayButton.Font = Enum.Font.SourceSans | |
| 216 | PlayButton.Text = "PLAY" | |
| 217 | PlayButton.TextColor3 = Color3.new(1, 1, 1) | |
| 218 | PlayButton.TextScaled = true | |
| 219 | PlayButton.TextSize = 14 | |
| 220 | PlayButton.TextWrapped = true | |
| 221 | ||
| 222 | PauseButton.Name = "PauseButton" | |
| 223 | PauseButton.Parent = Frame | |
| 224 | PauseButton.BackgroundColor3 = Color3.new(1, 0.666667, 0) | |
| 225 | PauseButton.BorderColor3 = Color3.new(0, 0, 0) | |
| 226 | PauseButton.BorderSizePixel = 0 | |
| 227 | PauseButton.Position = UDim2.new(0.334224582, 0, 0.734284222, 0) | |
| 228 | PauseButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0) | |
| 229 | PauseButton.Font = Enum.Font.SourceSans | |
| 230 | PauseButton.Text = "PAUSE" | |
| 231 | PauseButton.TextColor3 = Color3.new(1, 1, 1) | |
| 232 | PauseButton.TextScaled = true | |
| 233 | PauseButton.TextSize = 14 | |
| 234 | PauseButton.TextWrapped = true | |
| 235 | ||
| 236 | StopButton.Name = "StopButton" | |
| 237 | StopButton.Parent = Frame | |
| 238 | StopButton.BackgroundColor3 = Color3.new(1, 0, 0) | |
| 239 | StopButton.BorderColor3 = Color3.new(0, 0, 0) | |
| 240 | StopButton.BorderSizePixel = 0 | |
| 241 | StopButton.Position = UDim2.new(0.671122968, 0, 0.734284222, 0) | |
| 242 | StopButton.Size = UDim2.new(0.328342259, 0, 0.265715837, 0) | |
| 243 | StopButton.Font = Enum.Font.SourceSans | |
| 244 | StopButton.Text = "STOP" | |
| 245 | StopButton.TextColor3 = Color3.new(1, 1, 1) | |
| 246 | StopButton.TextScaled = true | |
| 247 | StopButton.TextSize = 14 | |
| 248 | StopButton.TextWrapped = true | |
| 249 | ||
| 250 | SoundID.Name = "SoundID" | |
| 251 | SoundID.Parent = Frame | |
| 252 | SoundID.BackgroundColor3 = Color3.new(0.333333, 0.666667, 1) | |
| 253 | SoundID.BorderColor3 = Color3.new(0, 0, 0) | |
| 254 | SoundID.BorderSizePixel = 3 | |
| 255 | SoundID.Position = UDim2.new(0.213903725, 0, 0.364500791, 0) | |
| 256 | SoundID.Size = UDim2.new(0.566310227, 0, 0.269043893, 0) | |
| 257 | SoundID.Font = Enum.Font.SourceSans | |
| 258 | SoundID.PlaceholderColor3 = Color3.new(1, 1, 1) | |
| 259 | SoundID.PlaceholderText = "Sound ID" | |
| 260 | SoundID.Text = "" | |
| 261 | SoundID.TextColor3 = Color3.new(1, 1, 1) | |
| 262 | SoundID.TextScaled = true | |
| 263 | SoundID.TextSize = 14 | |
| 264 | SoundID.TextWrapped = true | |
| 265 | ||
| 266 | local radio_billboard_gui = Instance.new("BillboardGui", character.Head)
| |
| 267 | radio_billboard_gui.Name = "RadioBillboardGUI" | |
| 268 | radio_billboard_gui.Adornee = character.Head | |
| 269 | radio_billboard_gui.AlwaysOnTop = true | |
| 270 | radio_billboard_gui.ExtentsOffsetWorldSpace = Vector3.new(0, 9, 0) | |
| 271 | radio_billboard_gui.Size = UDim2.new(8, 0, 6, 0) | |
| 272 | local radio_billboard_gui_textlabel = Instance.new("TextLabel", radio_billboard_gui)
| |
| 273 | radio_billboard_gui_textlabel.BackgroundTransparency = 1 | |
| 274 | radio_billboard_gui_textlabel.BorderColor3 = Color3.fromRGB(0, 0, 0) | |
| 275 | radio_billboard_gui_textlabel.BorderSizePixel = 0 | |
| 276 | radio_billboard_gui_textlabel.Size = UDim2.new(1, 0, 1, 0) | |
| 277 | radio_billboard_gui_textlabel.Text = "Right now playing: " | |
| 278 | radio_billboard_gui_textlabel.TextColor3 = Color3.fromRGB(0, 0, 0) | |
| 279 | radio_billboard_gui_textlabel.TextSize = 18 | |
| 280 | radio_billboard_gui_textlabel.TextWrapped = true | |
| 281 | ||
| 282 | function zigzag(x) | |
| 283 | return math.acos(math.cos(x * math.pi)) / math.pi | |
| 284 | end | |
| 285 | ||
| 286 | PlayButton.MouseButton1Click:Connect(function() | |
| 287 | if sound.IsPaused == true then | |
| 288 | sound:Resume() | |
| 289 | else | |
| 290 | sound.SoundId = "rbxassetid://"..tonumber(SoundID.Text) | |
| 291 | sound:Play() | |
| 292 | local info = market_place_service:GetProductInfo(tonumber(SoundID.Text)) | |
| 293 | radio_billboard_gui_textlabel.Text = "Right now playing: "..info.Name | |
| 294 | end | |
| 295 | end) | |
| 296 | ||
| 297 | PauseButton.MouseButton1Click:Connect(function() | |
| 298 | sound:Pause() | |
| 299 | end) | |
| 300 | ||
| 301 | StopButton.MouseButton1Click:Connect(function() | |
| 302 | sound:Stop() | |
| 303 | end) | |
| 304 | ||
| 305 | local while_wait_do1 = coroutine.create(function() | |
| 306 | local counter = 0 | |
| 307 | while wait(0.1) do | |
| 308 | Frame.BackgroundColor3 = Color3.fromHSV(zigzag(counter), 1, 1) | |
| 309 | counter = counter + 0.01 | |
| 310 | end | |
| 311 | end) | |
| 312 | coroutine.resume(while_wait_do1) | |
| 313 | ||
| 314 | local while_wait_do2 = coroutine.create(function() | |
| 315 | local counter = 0 | |
| 316 | while wait(0.1) do | |
| 317 | radio_billboard_gui_textlabel.TextColor3 = Color3.fromHSV(zigzag(counter), 1, 1) | |
| 318 | counter = counter + 0.01 | |
| 319 | end | |
| 320 | end) | |
| 321 | coroutine.resume(while_wait_do2) | |
| 322 | ||
| 323 | local while_wait_do3 = coroutine.create(function() | |
| 324 | while true do | |
| 325 | wait(0.005) | |
| 326 | radio_billboard_gui_textlabel.Rotation = radio_billboard_gui_textlabel.Rotation + 0.07 | |
| 327 | end | |
| 328 | end) | |
| 329 | coroutine.resume(while_wait_do3) |