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,game,owner = owner,game | |
| 3 | local RealPlayer = Player | |
| 4 | do | |
| 5 | print("FE Compatibility code by Mokiros")
| |
| 6 | local rp = RealPlayer | |
| 7 | script.Parent = rp.Character | |
| 8 | ||
| 9 | --RemoteEvent for communicating | |
| 10 | local Event = Instance.new("RemoteEvent")
| |
| 11 | Event.Name = "UserInput_Event" | |
| 12 | ||
| 13 | --Fake event to make stuff like Mouse.KeyDown work | |
| 14 | local function fakeEvent() | |
| 15 | local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
| |
| 16 | t.connect = t.Connect | |
| 17 | return t | |
| 18 | end | |
| 19 | ||
| 20 | --Creating fake input objects with fake variables | |
| 21 | local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
| |
| 22 | local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
| |
| 23 | local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
| |
| 24 | CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
| |
| 25 | end} | |
| 26 | --Merged 2 functions into one by checking amount of arguments | |
| 27 | CAS.UnbindAction = CAS.BindAction | |
| 28 | ||
| 29 | --This function will trigger the events that have been :Connect()'ed | |
| 30 | local function te(self,ev,...) | |
| 31 | local t = m[ev] | |
| 32 | if t and t._fakeEvent then | |
| 33 | for _,f in pairs(t.Functions) do | |
| 34 | f(...) | |
| 35 | end | |
| 36 | end | |
| 37 | end | |
| 38 | m.TrigEvent = te | |
| 39 | UIS.TrigEvent = te | |
| 40 | ||
| 41 | Event.OnServerEvent:Connect(function(plr,io) | |
| 42 | if plr~=rp then return end | |
| 43 | m.Target = io.Target | |
| 44 | m.Hit = io.Hit | |
| 45 | if not io.isMouse then | |
| 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 Mouse = Player:GetMouse() | |
| 66 | local UIS = game:GetService("UserInputService")
| |
| 67 | local input = function(io,a) | |
| 68 | if a then return end | |
| 69 | --Since InputObject is a client-side instance, we create and pass table instead | |
| 70 | Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
| |
| 71 | end | |
| 72 | UIS.InputBegan:Connect(input) | |
| 73 | UIS.InputEnded:Connect(input) | |
| 74 | ||
| 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 | ||
| 85 | ----Sandboxed game object that allows the usage of client-side methods and services | |
| 86 | --Real game object | |
| 87 | local _rg = game | |
| 88 | ||
| 89 | --Metatable for fake service | |
| 90 | local fsmt = {
| |
| 91 | __index = function(self,k) | |
| 92 | local s = rawget(self,"_RealService") | |
| 93 | if s then return s[k] end | |
| 94 | end, | |
| 95 | __newindex = function(self,k,v) | |
| 96 | local s = rawget(self,"_RealService") | |
| 97 | if s then s[k]=v end | |
| 98 | end, | |
| 99 | __call = function(self,...) | |
| 100 | local s = rawget(self,"_RealService") | |
| 101 | if s then return s(...) end | |
| 102 | end | |
| 103 | } | |
| 104 | local function FakeService(t,RealService) | |
| 105 | t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService | |
| 106 | return setmetatable(t,fsmt) | |
| 107 | end | |
| 108 | ||
| 109 | --Fake game object | |
| 110 | local g = {
| |
| 111 | GetService = function(self,s) | |
| 112 | return self[s] | |
| 113 | end, | |
| 114 | Players = FakeService({
| |
| 115 | LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
| |
| 116 | },"Players"), | |
| 117 | UserInputService = FakeService(UIS,"UserInputService"), | |
| 118 | ContextActionService = FakeService(CAS,"ContextActionService"), | |
| 119 | } | |
| 120 | rawset(g.Players,"localPlayer",g.Players.LocalPlayer) | |
| 121 | g.service = g.GetService | |
| 122 | ||
| 123 | g.RunService = FakeService({
| |
| 124 | RenderStepped = _rg:GetService("RunService").Heartbeat,
| |
| 125 | BindToRenderStep = function(self,name,_,fun) | |
| 126 | self._btrs[name] = self.Heartbeat:Connect(fun) | |
| 127 | end, | |
| 128 | UnbindFromRenderStep = function(self,name) | |
| 129 | self._btrs[name]:Disconnect() | |
| 130 | end, | |
| 131 | },"RunService") | |
| 132 | ||
| 133 | setmetatable(g,{
| |
| 134 | __index=function(self,s) | |
| 135 | return _rg:GetService(s) or typeof(_rg[s])=="function" | |
| 136 | and function(_,...)return _rg[s](_rg,...)end or _rg[s] | |
| 137 | end, | |
| 138 | __newindex = fsmt.__newindex, | |
| 139 | __call = fsmt.__call | |
| 140 | }) | |
| 141 | --Changing owner to fake player object to support owner:GetMouse() | |
| 142 | game,owner = g,g.Players.LocalPlayer | |
| 143 | end | |
| 144 | plr = game.Players.LocalPlayer | |
| 145 | repeat wait() until plr.Character | |
| 146 | char = plr.Character | |
| 147 | ||
| 148 | BRICKC = BrickColor.new | |
| 149 | inthenether = false | |
| 150 | ||
| 151 | function createimage(Type, Parent, Face, ID) | |
| 152 | local image = Instance.new(Type,Parent) | |
| 153 | image.Face = Face | |
| 154 | image.Texture = ID | |
| 155 | end | |
| 156 | function createtexture(Parent, Face, ID, StudsU, StudsV, Transparency) | |
| 157 | local image = Instance.new("Texture",Parent)
| |
| 158 | image.Face = Face | |
| 159 | image.Texture = ID | |
| 160 | image.StudsPerTileU = StudsU | |
| 161 | image.StudsPerTileV = StudsV | |
| 162 | image.Transparency = Transparency | |
| 163 | end | |
| 164 | function createpart(Parent, Material, BrickC, Anchored, CF, Name, Size, Collide, Orientation) | |
| 165 | local part = Instance.new("Part",Parent)
| |
| 166 | part.Material = Material | |
| 167 | part.BrickColor = BRICKC(tostring(BrickC)) | |
| 168 | part.Anchored = Anchored | |
| 169 | part.CFrame = CF | |
| 170 | part.Name = Name | |
| 171 | part.Size = Size | |
| 172 | part.CanCollide = Collide | |
| 173 | part.Orientation = Orientation | |
| 174 | end | |
| 175 | function createimageonallsides(ID, Parent) | |
| 176 | createimage("Decal", Parent, "Top", ID)
| |
| 177 | createimage("Decal", Parent, "Bottom", ID)
| |
| 178 | createimage("Decal", Parent, "Left", ID)
| |
| 179 | createimage("Decal", Parent, "Right", ID)
| |
| 180 | createimage("Decal",Parent, "Front", ID)
| |
| 181 | createimage("Decal", Parent, "Back", ID)
| |
| 182 | end | |
| 183 | ||
| 184 | local NetherPortal = Instance.new("Model",workspace)
| |
| 185 | NetherPortal.Name = "Portal" | |
| 186 | ||
| 187 | local Nether = Instance.new("Model",char)
| |
| 188 | Nether.Parent = nil | |
| 189 | Nether.Name = "Nether" | |
| 190 | ||
| 191 | ||
| 192 | function createportal() | |
| 193 | local part1 = createpart(NetherPortal, "Slate", BRICKC("Really black"), true, CFrame.new(-0.19, 18, -11.43),"Part1", Vector3.new(4,4,4), true, Vector3.new(0,0,0))
| |
| 194 | local part2 = createpart(NetherPortal, "Slate", BRICKC("Really black"), true, CFrame.new(-12.19, 14, -11.43),"Part2", Vector3.new(4,4,4), true, Vector3.new(0,0,0))
| |
| 195 | local part3 = createpart(NetherPortal, "Slate", BRICKC("Really black"), true, CFrame.new(-8.19, 18, -11.43),"Part3", Vector3.new(4,4,4), true, Vector3.new(0,0,0))
| |
| 196 | local part4 = createpart(NetherPortal, "Slate", BRICKC("Really black"), true, CFrame.new(-4.19, 18, -11.43), "Part4", Vector3.new(4,4,4), true, Vector3.new(0,0,0))
| |
| 197 | local part5 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-0.19, 14, -11.43), "Part5", Vector3.new(4,4,4),true, Vector3.new(0,0,0)) | |
| 198 | local part6 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-12.19, 10, -11.43), "Part6", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 199 | local part7 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-12.19, 18, -11.43), "Part7", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 200 | local part8 = createpart(NetherPortal, "Slate", BRICKC'Bright violet', true, CFrame.new(-6.142, 10, -11.466), "Part8", Vector3.new(8, 1.6, 12), false, Vector3.new(90,0,0)) | |
| 201 | local part9 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-0.19, 10, -11.43), "Part9", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 202 | local part10 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-12.19, 6, -11.43), "Part10", Vector3.new(4,4,4), true , Vector3.new(0,0,0)) | |
| 203 | local part11 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-12.19, 2, -11.43), "Part11", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 204 | local part12 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-4.19, 2, -11.43), "Part12", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 205 | local part13 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-0.19, 6, -11.43), "Part13", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 206 | local part14 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-8.19, 2, -11.43), "Part14", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 207 | local part15 = createpart(NetherPortal, "Slate", BRICKC'Really black', true, CFrame.new(-0.19, 2, -11.43), "Part15", Vector3.new(4,4,4), true, Vector3.new(0,0,0)) | |
| 208 | end | |
| 209 | ||
| 210 | createportal() | |
| 211 | ||
| 212 | ||
| 213 | function generatenether() | |
| 214 | local base = createpart(Nether, "Plastic", BRICKC'Bright green', true, CFrame.new(-11.935, 5000, -45.017), "Base", Vector3.new(377.7, 399.93, 2),true, Vector3.new(90,0,0)) | |
| 215 | local wall1 = createpart(Nether, "Plastic", BRICKC'Bright green', true, CFrame.new(-191.117, 5212.282, -43.413), "Wall1", Vector3.new(404.32, 421.87, 4),true, Vector3.new(0, -90, 0)) | |
| 216 | local wall2 = createpart(Nether, "Plastic", BRICKC'Bright green', true, CFrame.new(178.849, 5212.282, -43.413), "Wall2", Vector3.new(404.32, 421.87, 4),true, Vector3.new(0, 90, 0)) | |
| 217 | local wall3 = createpart(Nether, "Plastic", BRICKC'Bright green', true, CFrame.new(-8.58, 5212.282, -244.122), "Wall3", Vector3.new(370.83, 421.87, 4), true, Vector3.new(0, 180, 180)) | |
| 218 | local wall4 = createpart(Nether, "Plastic", BRICKC'Bright green', true, CFrame.new(-8.58, 5212.282, 155.843), "Wall4", Vector3.new(370.83, 421.87, 4), true, Vector3.new(0, 180, 180)) | |
| 219 | local roof = createpart(Nether, "Plastic", BRICKC'Bright green', true, CFrame.new(-11.935, 5415.161, -45.017), "Roof", Vector3.new(370.83, 421.87, 4), true, Vector3.new(-90, 0, 0)) | |
| 220 | end | |
| 221 | ||
| 222 | ||
| 223 | for i,v in pairs(NetherPortal:GetChildren()) do | |
| 224 | if v.Name ~= "Part8" then | |
| 225 | ||
| 226 | end | |
| 227 | if v.Name == "Part8" then | |
| 228 | createtexture(v, "Top", "http://www.roblox.com/asset/?id=77399998", 4 , 4, 0.1) | |
| 229 | createtexture(v, "Bottom", "http://www.roblox.com/asset/?id=77399998", 4, 4, 0.1) | |
| 230 | v.Transparency = 0.7 | |
| 231 | end | |
| 232 | end | |
| 233 | timer = 50 | |
| 234 | generatenether() | |
| 235 | local NetherTheme = Instance.new("Sound",char)
| |
| 236 | NetherTheme.SoundId = "rbxassetid://169283546" | |
| 237 | NetherTheme.Volume = 4 | |
| 238 | NetherTheme.Looped = true | |
| 239 | for i,v in pairs(Nether:GetChildren()) do | |
| 240 | if v.Name ~= "Base" then | |
| 241 | createtexture(v, "Front", "rbxassetid://75881126", 4, 4, 0) | |
| 242 | end | |
| 243 | if v.Name == "Base" and v.Name ~= "Wall4" then | |
| 244 | createtexture(v, "Front", "rbxassetid://42112689", 4, 4, 0) | |
| 245 | end | |
| 246 | if v.Name == "Wall4" then | |
| 247 | createtexture(v, "Back", "rbxassetid://75881126", 4, 4, 0) | |
| 248 | end | |
| 249 | v.Anchored = true | |
| 250 | v.CanCollide = true | |
| 251 | end | |
| 252 | ||
| 253 | ||
| 254 | ||
| 255 | ||
| 256 | screen = Instance.new("ScreenGui")
| |
| 257 | frame = Instance.new("Frame", screen)
| |
| 258 | frame.Size = UDim2.new(1,0 , 1,0) | |
| 259 | frame.BackgroundTransparency = 1 | |
| 260 | frame.BackgroundColor3 = BRICKC'Royal purple'.Color | |
| 261 | ||
| 262 | local idle = Instance.new("Sound",NetherPortal)
| |
| 263 | idle.SoundId = "rbxassetid://144392025" | |
| 264 | idle.Volume = 4 | |
| 265 | NetherPortal.Part8.Touched:connect(function(part) | |
| 266 | local human = part.Parent:FindFirstChildOfClass("Humanoid")
| |
| 267 | if human then | |
| 268 | screen.Parent = game.Players[human.Parent.Name].PlayerGui | |
| 269 | for i = 1,timer do | |
| 270 | wait() | |
| 271 | frame.BackgroundTransparency = frame.BackgroundTransparency - 0.0005 | |
| 272 | end | |
| 273 | Nether.Parent = char | |
| 274 | human.Parent.Torso.CFrame = Nether.Base.CFrame + Vector3.new(0, 5, 0) | |
| 275 | NetherTheme:Play() | |
| 276 | screen.Parent = nil | |
| 277 | inthenether = true | |
| 278 | end | |
| 279 | end) | |
| 280 | while true do | |
| 281 | wait() | |
| 282 | if not inthenether then | |
| 283 | wait(math.random(1,5)) | |
| 284 | idle:Play() | |
| 285 | repeat wait() until idle.IsPlaying == false | |
| 286 | end | |
| 287 | end |