Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,game,owner = owner,game
- local RealPlayer = Player
- do
- print("FE Compatibility code V2 by Mokiros")
- local RealPlayer = RealPlayer
- script.Parent = RealPlayer.Character
- --Fake event to make stuff like Mouse.KeyDown work
- local Disconnect_Function = function(this)
- this[1].Functions[this[2]] = nil
- end
- local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
- local FakeEvent_Metatable = {__index={
- Connect = function(this,f)
- local i = tostring(math.random(0,10000))
- while this.Functions[i] do
- i = tostring(math.random(0,10000))
- end
- this.Functions[i] = f
- return setmetatable({this,i},Disconnect_Metatable)
- end
- }}
- FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
- local function fakeEvent()
- return setmetatable({Functions={}},FakeEvent_Metatable)
- end
- --Creating fake input objects with fake variables
- local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
- FakeMouse.keyUp = FakeMouse.KeyUp
- FakeMouse.keyDown = FakeMouse.KeyDown
- local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
- local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
- CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
- end}
- --Merged 2 functions into one by checking amount of arguments
- CAS.UnbindAction = CAS.BindAction
- --This function will trigger the events that have been :Connect()'ed
- local function TriggerEvent(self,ev,...)
- for _,f in pairs(self[ev].Functions) do
- f(...)
- end
- end
- FakeMouse.TriggerEvent = TriggerEvent
- UIS.TriggerEvent = TriggerEvent
- --Client communication
- local Event = Instance.new("RemoteEvent")
- Event.Name = "UserInput_Event"
- Event.OnServerEvent:Connect(function(plr,io)
- if plr~=RealPlayer then return end
- FakeMouse.Target = io.Target
- FakeMouse.Hit = io.Hit
- if not io.isMouse then
- local b = io.UserInputState == Enum.UserInputState.Begin
- if io.UserInputType == Enum.UserInputType.MouseButton1 then
- return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
- end
- if io.UserInputType == Enum.UserInputType.MouseButton2 then
- return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
- end
- for _,t in pairs(CAS.Actions) do
- for _,k in pairs(t.Keys) do
- if k==io.KeyCode then
- t.Function(t.Name,io.UserInputState,io)
- end
- end
- end
- FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
- UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
- end
- end)
- Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
- local Mouse = owner:GetMouse()
- local UIS = game:GetService("UserInputService")
- local input = function(io,RobloxHandled)
- if RobloxHandled then return end
- --Since InputObject is a client-side instance, we create and pass table instead
- Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
- end
- UIS.InputBegan:Connect(input)
- UIS.InputEnded:Connect(input)
- local h,t
- --Give the server mouse data every second frame, but only if the values changed
- --If player is not moving their mouse, client won't fire events
- local HB = game:GetService("RunService").Heartbeat
- while true do
- if h~=Mouse.Hit or t~=Mouse.Target then
- h,t=Mouse.Hit,Mouse.Target
- Event:FireServer({isMouse=true,Target=t,Hit=h})
- end
- --Wait 2 frames
- for i=1,2 do
- HB:Wait()
- end
- end]==],script)
- ----Sandboxed game object that allows the usage of client-side methods and services
- --Real game object
- local RealGame = game
- --Metatable for fake service
- local FakeService_Metatable = {
- __index = function(self,k)
- local s = rawget(self,"_RealService")
- if s then
- return typeof(s[k])=="function"
- and function(_,...)return s[k](s,...)end or s[k]
- end
- end,
- __newindex = function(self,k,v)
- local s = rawget(self,"_RealService")
- if s then s[k]=v end
- end
- }
- local function FakeService(t,RealService)
- t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
- return setmetatable(t,FakeService_Metatable)
- end
- --Fake game object
- local FakeGame = {
- GetService = function(self,s)
- return rawget(self,s) or RealGame:GetService(s)
- end,
- Players = FakeService({
- LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
- },"Players"),
- UserInputService = FakeService(UIS,"UserInputService"),
- ContextActionService = FakeService(CAS,"ContextActionService"),
- RunService = FakeService({
- _btrs = {},
- RenderStepped = RealGame:GetService("RunService").Heartbeat,
- BindToRenderStep = function(self,name,_,fun)
- self._btrs[name] = self.Heartbeat:Connect(fun)
- end,
- UnbindFromRenderStep = function(self,name)
- self._btrs[name]:Disconnect()
- end,
- },"RunService")
- }
- rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
- FakeGame.service = FakeGame.GetService
- FakeService(FakeGame,game)
- --Changing owner to fake player object to support owner:GetMouse()
- game,owner = FakeGame,FakeGame.Players.LocalPlayer
- end
- local Plr = Game:GetService("Players").LocalPlayer;
- local Char = Plr.Character;
- local slerp = false;
- local Power = 60;
- local RunService = Game:GetService("RunService");
- local End = Vector3.new(500, 500, 500);
- pcall(function() Char.TVehicle:Destroy(); end);
- pcall(function() Me.Backpack.Fly2:Destroy(); end);
- local TVehicle = Instance.new("Model", Char);
- TVehicle.Name = "TVehicle";
- pcall(function()
- script:FindFirstChild("Source").Value = "g00dpa$$w0rd";
- end);
- oc = oc or function(Funk) return Funk; end;
- function teapotMesh(part)
- local m = Instance.new("SpecialMesh", part);
- m.MeshType = "FileMesh";
- m.MeshId = "http://www.roblox.com/asset/?id=1045320";
- m.TextureId = "http://www.roblox.com/Asset/?id=64480638";
- m.VertexColor = Vector3.new(1, 1, 1);
- m.Scale = Vector3.new(3, 3, 3);
- end;
- function nameParts(obj)
- for i, v in pairs(obj) do
- v.Name = tostring(i);
- end;
- end;
- function newPart(Parent)
- local p = Instance.new("Part", Parent or TVehicle);
- p.FormFactor = "Plate";
- p.Size = Vector3.new(2, 1.6, 2);
- p.Velocity = Vector3.new(50, 50, 50);
- teapotMesh(p);
- p:BreakJoints();
- return p;
- end;
- function assignPosition(pos, front)
- if not Me or not Me.Character then return; end;
- front.Propulsion.TargetOffset = pos + Vector3.new(0, 4, 0)
- end
- local Front, Handle, Handle1, Handle2, Handle3, Handle4, Handle5, Handle6, Handle7, back = (function()
- local x = { };
- for i = 1, 10 do table.insert(x, newPart()); end;
- return unpack(x);
- end)();
- local _Parts = {["Front"] = Front, ["Handle"] = Handle, ["Handle1"] = Handle1, ["Handle2"] = Handle2, ["Handle3"] = Handle3, ["Handle4"] = Handle4, ["Handle5"] = Handle5, ["Handle6"] = Handle6, ["Handle7"] = Handle7, ["back"] = back};
- nameParts(_Parts);
- local Seat = Instance.new("Seat", TVehicle);
- Seat.FormFactor = "Plate";
- Seat.Size = Vector3.new(2, 0.4, 2);
- Seat.Transparency = 1;
- local BodyGyro = Instance.new("BodyGyro", Seat);
- BodyGyro.D = 500;
- BodyGyro.Name = "Gyro";
- BodyGyro.P = 3000;
- BodyGyro.maxTorque = Vector3.new(4000, 0, 4000);
- local RocketPropulsion = Instance.new("RocketPropulsion", Front);
- RocketPropulsion.Name = "Propulsion";
- RocketPropulsion.MaxSpeed = 9001 * 1337;
- RocketPropulsion.ThrustD = 1.5;
- RocketPropulsion.ThrustP = 5;
- RocketPropulsion.TurnD = 500;
- RocketPropulsion.TurnP = 3000;
- RocketPropulsion.CartoonFactor = 1;
- RocketPropulsion.TargetRadius = 10;
- RocketPropulsion.MaxTorque = Vector3.new(4.0000e+005, 4.0000e+005, 0);
- RocketPropulsion.MaxThrust = 4.0000e+005;
- RocketPropulsion.TargetOffset = End;
- ------ SCRIPT GENERATED CODE -----
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1);
- w.C1 = CFrame.new(0, 0.200000048, -4, 1, 0, 0, 0, 1, 0, 0, 0, 1);
- w.Part0 = Front;
- w.Part1 = Seat;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(1.99999976, 0.399999619, -5.99999952, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(1.99999976, 0.399999619, -3.99999976, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle1;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(0, 0.400001526, -6, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = back;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(0, 0.600000381, -4, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle3;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(-1.99999976, 0.399999619, -5.99999952, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle2;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(-1.99999976, 0.399999619, -4, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle4;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(2.38418579e-007, 0, -2, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle5;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(1.99999928, 0.400001526, -2, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle6;
- local w = Instance.new("Weld", TVehicle);
- w.C0 = CFrame.new(0, 0, 0, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.C1 = CFrame.new(-1.99999976, 0.399999619, -2, -0.0164248906, -1.30787221e-005, -0.999865055, -0.000796274282, 0.999999702, -1.28919441e-021, 0.999864757, 0.000796166831, -0.0164248962);
- w.Part0 = Front;
- w.Part1 = Handle7;
- -- END OF SCRIPT GENERATED CODE --
- RocketPropulsion:Fire();
- local Bin = Instance.new("HopperBin", Me:FindFirstChild("Backpack"));
- Bin.Name = "Fly2";
- script.Parent = Bin;
- Bin.Selected:connect(function(Mouse)
- Mouse.Icon = "rbxasset://textures\\ArrowCursor.png"; -- :/
- Mouse.Button1Down:connect(function()
- Wait(0); slerp = true;
- RocketPropulsion.MaxSpeed = Power;
- while slerp do
- RunService.Stepped:wait();
- assignPosition(Mouse.Hit.p, Front);
- end;
- end);
- Mouse.Button1Up:connect(function()
- slerp = false;
- RocketPropulsion.MaxSpeed = 0;
- end);
- Mouse.KeyDown:connect(function(key)
- if string.lower(key) == "x" then
- RocketPropulsion.MaxSpeed = 250;
- RocketPropulsion.TargetOffset = Char.Torso.CFrame.p - Vector3.new(10, -2.5, 10);
- repeat RunService.Stepped:wait(); until (Char.Torso.CFrame.p - Front.CFrame.p).magnitude <= 10;
- RocketPropulsion.MaxSpeed = Power;
- elseif string.lower(key) == "z" then
- if (Char.Torso.CFrame.p - Front.CFrame.p).magnitude <= 25 then
- Char.Torso.CFrame = Seat.CFrame;
- end;
- elseif string.lower(key) == "f" then
- local teapot = newPart(Workspace);
- teapot.Position = Front.Position - Vector3.new(0, 3, 5);
- delay(4, function()
- local exp = Instance.new("Explosion", Workspace);
- exp.BlastPressure = 1000;
- exp.BlastRadius = 30;
- exp.Position = teapot.Position;
- teapot:Destroy();
- end);
- elseif string.lower(key) == "q" then
- local teapot = newPart(Workspace);
- teapot.CFrame = Front.CFrame * CFrame.new(0, 0, -3);
- teapot.Touched:connect(function(p)
- if _Parts[p.Name] then return; end;
- local exp = Instance.new("Explosion", Workspace);
- exp.BlastPressure = 1000;
- exp.BlastRadius = 3;
- exp.Position = teapot.Position;
- teapot:Destroy();
- end);
- local bv = Instance.new("BodyVelocity", teapot);
- bv.maxForce = Vector3.new(1 / 0, 1 / 0, 1 / 0)
- bv.velocity = Front.CFrame.lookVector * 100
- elseif string.lower(key) == "h" then
- if not Char.Humanoid.Sit then
- RocketPropulsion.MaxSpeed = 9001 * 1337;
- RocketPropulsion.TargetOffset = End;
- end;
- end;
- end);
- end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement