Advertisement
plytalent

inv ghost

Jul 14th, 2018
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.07 KB | None | 0 0
  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,Mouse,mouse,UserInputService,ContextActionService = owner
  3. do
  4.     print("FE Compatibility code by Mokiros")
  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. Player = owner
  84. plr = Player
  85.  
  86. part = nil
  87. bp = nil
  88. particles = nil
  89. -----
  90. local char = plr.Character
  91. local hum = char:FindFirstChildOfClass'Humanoid'
  92. local hed = char.Head
  93. local root = char:FindFirstChild'HumanoidRootPart'
  94. local rootj = root.RootJoint
  95. local tors = char.Torso
  96. local ra = char["Right Arm"]
  97. local la = char["Left Arm"]
  98. local rl = char["Right Leg"]
  99. local ll = char["Left Leg"]
  100. local neck = tors["Neck"]
  101. local mouse = plr:GetMouse()
  102. local RootCF = CFrame.fromEulerAnglesXYZ(-1.57, 0, 3.14)
  103. local RHCF = CFrame.fromEulerAnglesXYZ(0, 1.6, 0)
  104. local LHCF = CFrame.fromEulerAnglesXYZ(0, -1.6, 0)
  105. local maincolor = BrickColor.new("Institutional white")
  106. cam = game.Workspace.CurrentCamera
  107. CF = CFrame.new
  108. angles = CFrame.Angles
  109. attack = false
  110. Euler = CFrame.fromEulerAnglesXYZ
  111. Rad = math.rad
  112. IT = Instance.new
  113. BrickC = BrickColor.new
  114. Cos = math.cos
  115. Acos = math.acos
  116. Sin = math.sin
  117. Asin = math.asin
  118. Abs = math.abs
  119. Mrandom = math.random
  120. Floor = math.floor
  121. --script hair
  122. --repeat
  123. --wait(0.5)
  124. --Player:FindFirstChildOfClass("Accessory"):Destroy()
  125. --until Player:FindFirstChildOfClass("Accessory") == nil
  126. --HSHair = IT("Model")
  127. --HSHair.Parent = char
  128. --HSHair.Name = "HSHair"
  129. --RHe = IT("Part")
  130. --RHe.Parent = HSHair
  131. --RHe.BrickColor = BrickColor.new("Really red")
  132. --RHe.Locked = true
  133. --RHe.CanCollide = false
  134. --RHe.Transparency = 0
  135. --PMesh = IT("SpecialMesh")
  136. --RHe.formFactor =  "Symmetric"
  137. --PMesh.MeshType = "FileMesh"
  138. --PMesh.MeshId = "rbxassetid://731023666"
  139. --PMesh.Scale = Vector3.new(0.200000003, 0.200000003, 0.170000002)
  140. --PMesh.Parent = RHe
  141. --local RWeld = IT("Weld")
  142. --RWeld.Parent = RHe
  143. --RWeld.Part0 = RHe
  144. --RWeld.Part1 = hed
  145. --RWeld.C0 = CF(0, 2.5, 1) * angles(0, Rad(180), 0)
  146. ---------------------------------------------------
  147. Mouse.KeyDown:connect(function(key)
  148.     if key == "e" and plr.Character.Parent == workspace then
  149.         plr.Character.Parent = workspace.Camera
  150.         plr.Character.Archivable = true
  151.         Instance.new("ForceField",plr.Character).Visible = false
  152.         for y,t in pairs(plr.Character:GetChildren()) do
  153.             if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  154.                 t.Transparency = 0
  155.                 if t.Name == "Head" and t:FindFirstChild("face") then
  156.                     t.face.Transparency = 0
  157.                 end
  158.             elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  159.                 t.Handle.Transparency = 0
  160.             end
  161.         end
  162.     elseif key == "r" then
  163.         script.Disabled = true
  164.     elseif key == "t" and plr.Character.Parent == workspace.Camera and part == nil then
  165.         plr.Character.Parent = workspace
  166.         plr.Character.Archivable = false
  167.         plr.Character:FindFirstChildOfClass("ForceField"):Remove()
  168.         for y,t in pairs(plr.Character:GetChildren()) do
  169.             if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  170.                 t.Transparency = 0
  171.                 if t.Name == "Head" and t:FindFirstChild("face") then
  172.                     t.face.Transparency = 0
  173.                 end
  174.             elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  175.                 t.Handle.Transparency = 0
  176.             end
  177.         end
  178.     end
  179. end)
  180. Mouse.Button1Down:connect(function()
  181.     if plr.Character.Parent == workspace.Camera or plr.Character.Parent == workspace then
  182.         if mouse ~= nil then
  183.             if mouse.Target ~= nil then
  184.                 part = mouse.Target
  185.                 bp = Instance.new("BodyPosition",part)
  186.                 bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  187.                 bp.Position = part.Position
  188.                 particles = Instance.new("ParticleEmitter",part)
  189.                 particles.Color = ColorSequence.new(Color3.new(255, 85, 255))
  190.                 particles.Size = NumberSequence.new(1)
  191.                 particles.Texture = "rbxassetid://292289455"
  192.                 particles.VelocitySpread = 0
  193.                 particles.Speed = NumberRange.new(0)
  194.                 particles.RotSpeed = NumberRange.new(0)
  195.                 particles.Rotation = NumberRange.new(0)
  196.                 particles.Rate = 0
  197.                 particles.Lifetime = NumberRange.new(.2,.4)
  198.                 particles.Transparency = NumberSequence.new(1,1)
  199.                 dwn = true
  200.             end
  201.         end
  202.         while dwn == true do
  203.             wait() 
  204.             bp.Position = mouse.hit.p
  205.             if part then
  206.                 if part.Parent:FindFirstChildOfClass("Humanoid") then
  207.                     part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = true
  208.                 end
  209.             end
  210.         end
  211.     end
  212. end)
  213. Mouse.Button1Up:connect(function()
  214.     dwn = false
  215.     if part then if part.Parent:FindFirstChildOfClass("Humanoid") then part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false end part = nil end
  216.     if bp then bp:Destroy() end
  217.     if particles then particles:Destroy() end
  218. end)
  219. touchCounter = 0
  220. while wait() do
  221.     if plr.Character.Parent == workspace.Camera then
  222.         local c = plr.Character:Clone()
  223.         c:MakeJoints()
  224.         for y,t in pairs(c:GetChildren()) do
  225.             if t:IsA("Part") then
  226.                 t.CanCollide = false
  227.                 t.Anchored = true
  228.                 t.Transparency = 0.90
  229.                 t.TopSurface = "Smooth"
  230.                 t.BottomSurface = "Smooth"
  231.                 t.RightSurface = "Smooth"
  232.                 t.LeftSurface = "Smooth"
  233.                 t.FrontSurface = "Smooth"
  234.                 t.BackSurface = "Smooth"
  235.                 t.BrickColor = BrickColor.new("Pink")
  236.                 if t.Name == "Head" and t:FindFirstChild("face") then
  237. --                  t.face:Remove()
  238.                 elseif t.Name == "Torso" and t:FindFirstChild("roblox") then
  239. --                  t.roblox:Remove()
  240.                 elseif t.Name == "HumanoidRootPart" then
  241. --                  t:Remove()
  242.                 end
  243.             else
  244.                 t:Remove()
  245.             end
  246.         end
  247.         c.Parent = workspace
  248.         game.Debris:AddItem(c,.05)
  249.     end
  250. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement