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 | ||
| 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 | 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 | --Made by N3xul | |
| 88 | local runDummyScript = function(f,scri) | |
| 89 | local oldenv = getfenv(f) | |
| 90 | local newenv = setmetatable({}, {
| |
| 91 | __index = function(_, k) | |
| 92 | if k:lower() == 'script' then | |
| 93 | return scri | |
| 94 | else | |
| 95 | return oldenv[k] | |
| 96 | end | |
| 97 | end | |
| 98 | }) | |
| 99 | setfenv(f, newenv) | |
| 100 | ypcall(function() f() end) | |
| 101 | end | |
| 102 | cors = {}
| |
| 103 | mas = Instance.new("Model",game:GetService("Lighting"))
| |
| 104 | mas.Name = "CompiledModel" | |
| 105 | o1 = Instance.new("ScreenGui")
| |
| 106 | o2 = Instance.new("Frame")
| |
| 107 | o3 = Instance.new("TextButton")
| |
| 108 | o4 = Instance.new("TextButton")
| |
| 109 | o5 = Instance.new("TextLabel")
| |
| 110 | o6 = Instance.new("ImageButton")
| |
| 111 | - | pcall(function() cam.CameraSubject = game.Players.LocalPlayer.Character.Humanoid end) |
| 111 | + | |
| 112 | o1.Name = "SpectateGui" | |
| 113 | o1.Parent = mas | |
| 114 | o2.Name = "Bar" | |
| 115 | o2.Parent = o1 | |
| 116 | o2.Position = UDim2.new(-1,-100,0.87999999523163,-50) | |
| 117 | o2.Size = UDim2.new(0,200,0,50) | |
| 118 | o2.Position = UDim2.new(-1,-100,0.87999999523163,-50) | |
| 119 | o2.BackgroundColor3 = Color3.new(0, 0, 0) | |
| 120 | o2.BackgroundTransparency = 0.20000000298023 | |
| 121 | o2.BorderSizePixel = 5 | |
| 122 | o3.Name = "Previous" | |
| 123 | o3.Parent = o2 | |
| 124 | o3.Size = UDim2.new(0.25,0,1,0) | |
| 125 | o3.Text = "<" | |
| 126 | o3.BackgroundColor3 = Color3.new(0.52549, 0.52549, 0.52549) | |
| 127 | o3.BorderColor3 = Color3.new(0.509804, 0.796079, 1) | |
| 128 | o3.BorderSizePixel = 0 | |
| 129 | o3.Font = Enum.Font.SourceSans | |
| 130 | o3.FontSize = Enum.FontSize.Size48 | |
| 131 | o3.TextColor3 = Color3.new(1, 1, 1) | |
| 132 | o4.Name = "Next" | |
| 133 | o4.Parent = o2 | |
| 134 | o4.Position = UDim2.new(1,0,0,0) | |
| 135 | o4.Size = UDim2.new(-0.25,0,1,0) | |
| 136 | o4.Text = ">" | |
| 137 | o4.Position = UDim2.new(1,0,0,0) | |
| 138 | o4.BackgroundColor3 = Color3.new(0.52549, 0.52549, 0.52549) | |
| 139 | o4.BorderColor3 = Color3.new(0.509804, 0.796079, 1) | |
| 140 | o4.BorderSizePixel = 0 | |
| 141 | o4.Font = Enum.Font.SourceSans | |
| 142 | o4.FontSize = Enum.FontSize.Size48 | |
| 143 | o4.TextColor3 = Color3.new(1, 1, 1) | |
| 144 | o5.Name = "Title" | |
| 145 | o5.Parent = o2 | |
| 146 | o5.Position = UDim2.new(0.27500000596046,0,0,0) | |
| 147 | o5.Size = UDim2.new(0.44999998807907,0,1,0) | |
| 148 | o5.Text = "" | |
| 149 | o5.Position = UDim2.new(0.27500000596046,0,0,0) | |
| 150 | o5.BackgroundColor3 = Color3.new(1, 1, 1) | |
| 151 | - | mas1[i].Parent = game:GetService("Players").LocalPlayer.PlayerGui
|
| 151 | + | |
| 152 | o5.Font = Enum.Font.SourceSans | |
| 153 | o5.FontSize = Enum.FontSize.Size14 | |
| 154 | o5.TextColor3 = Color3.new(1, 1, 1) | |
| 155 | o5.TextScaled = true | |
| 156 | o5.TextWrapped = true | |
| 157 | o6.Name = "Button" | |
| 158 | o6.Parent = o1 | |
| 159 | o6.Position = UDim2.new(0,0,0.5,-25) | |
| 160 | o6.Size = UDim2.new(0,50,0,50) | |
| 161 | o6.Position = UDim2.new(0,0,0.5,-25) | |
| 162 | o6.BackgroundColor3 = Color3.new(1, 1, 1) | |
| 163 | o6.BackgroundTransparency = 0.30000001192093 | |
| 164 | o6.BorderSizePixel = 5 | |
| 165 | o6.Image = "http://www.roblox.com/asset/?id=176106970" | |
| 166 | o7.Parent = o1 | |
| 167 | table.insert(cors,coroutine.create(function() | |
| 168 | wait() | |
| 169 | runDummyScript(function() | |
| 170 | -- By super10099 | |
| 171 | ||
| 172 | cam = game.Workspace.CurrentCamera | |
| 173 | ||
| 174 | local bar = script.Parent.Bar | |
| 175 | local title = bar.Title | |
| 176 | local prev = bar.Previous | |
| 177 | local nex = bar.Next | |
| 178 | local button = script.Parent.Button | |
| 179 | ||
| 180 | function get() | |
| 181 | for _,v in pairs(game.Players:GetPlayers())do | |
| 182 | if v.Name == title.Text then | |
| 183 | return(_) | |
| 184 | end | |
| 185 | end | |
| 186 | end | |
| 187 | ||
| 188 | ||
| 189 | local debounce = false | |
| 190 | button.MouseButton1Click:connect(function() | |
| 191 | if debounce == false then debounce = true | |
| 192 | bar:TweenPosition(UDim2.new(.5,-100,0.88,-50),"In","Linear",1,true) | |
| 193 | pcall(function() | |
| 194 | title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name | |
| 195 | end) | |
| 196 | elseif debounce == true then debounce = false | |
| 197 | pcall(function() cam.CameraSubject = game.Players.von12222222.Character.Humanoid end) | |
| 198 | bar:TweenPosition(UDim2.new(-1,-100,0.88,-50),"In","Linear",1,true) | |
| 199 | end | |
| 200 | end) | |
| 201 | ||
| 202 | prev.MouseButton1Click:connect(function() | |
| 203 | wait(.1) | |
| 204 | local players = game.Players:GetPlayers() | |
| 205 | local num = get() | |
| 206 | if not pcall(function() | |
| 207 | cam.CameraSubject = players[num-1].Character.Humanoid | |
| 208 | end) then | |
| 209 | cam.CameraSubject = players[#players].Character.Humanoid | |
| 210 | end | |
| 211 | pcall(function() | |
| 212 | title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name | |
| 213 | end) | |
| 214 | end) | |
| 215 | ||
| 216 | nex.MouseButton1Click:connect(function() | |
| 217 | wait(.1) | |
| 218 | local players = game.Players:GetPlayers() | |
| 219 | local num = get() | |
| 220 | if not pcall(function() | |
| 221 | cam.CameraSubject = players[num+1].Character.Humanoid | |
| 222 | end) then | |
| 223 | cam.CameraSubject = players[1].Character.Humanoid | |
| 224 | end | |
| 225 | pcall(function() | |
| 226 | title.Text = game.Players:GetPlayerFromCharacter(cam.CameraSubject.Parent).Name | |
| 227 | end) | |
| 228 | end) | |
| 229 | ||
| 230 | ||
| 231 | end,o7) | |
| 232 | end)) | |
| 233 | mas.Parent = workspace | |
| 234 | mas:MakeJoints() | |
| 235 | local mas1 = mas:GetChildren() | |
| 236 | for i=1,#mas1 do | |
| 237 | mas1[i].Parent = game:GetService("Players").von12222222.PlayerGui
| |
| 238 | ypcall(function() mas1[i]:MakeJoints() end) | |
| 239 | end | |
| 240 | mas:Destroy() | |
| 241 | for i=1,#cors do | |
| 242 | coroutine.resume(cors[i]) | |
| 243 | end |