SHADOWCRAFTER666

Untitled

Nov 23rd, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.34 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 | Translated to FE by SHADOWCRAFTER666 (Nobody#4931)")
  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.  
  84. plr = owner
  85. part = nil
  86. bp = nil
  87. particles = nil
  88. function clerp(a,b,c,d)
  89. for i = 0,d,.01 do
  90. a.CFrame = CFrame.new(b:lerp(c,i))
  91. wait()
  92. end
  93. end
  94. function slerp(a2,b2,c2,d2)
  95. for i2 = 0,d2,.01 do
  96. a2.CFrame = CFrame.new(b2:lerp(c2,i2))
  97. wait()
  98. end
  99. end
  100. mouse.KeyDown:connect(function(key)
  101. if key == "e" and plr.Character.Parent == workspace then
  102. plr.Character.Parent = workspace.Camera
  103. plr.Character.Archivable = true
  104. Instance.new("ForceField",plr.Character).Visible = false
  105. for y,t in pairs(plr.Character:GetChildren()) do
  106. if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  107. t.Transparency = 1
  108. if t.Name == "Head" and t:FindFirstChild("face") then
  109. t.face.Transparency = 1
  110. end
  111. elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  112. t.Handle.Transparency = 1
  113. end
  114. end
  115. elseif key == "z" and plr.Character.Parent == workspace.Camera and part == nil then
  116. plr.Character.Torso.CFrame = CFrame.new(Vector3.new(mouse.hit.p.X,mouse.hit.p.Y+1.5,mouse.hit.p.Z),plr.Character.Torso.CFrame.p)
  117. elseif key == "x" and plr.Character.Parent == workspace.Camera and part == nil then
  118. if plr.Character.Torso.Anchored == true then
  119. for y,t in pairs(plr.Character:GetChildren()) do
  120. if t:IsA("Part") then
  121. t.Anchored = false
  122. end
  123. end
  124. else
  125. for y,t in pairs(plr.Character:GetChildren()) do
  126. if t:IsA("Part") then
  127. t.Anchored = true
  128. end
  129. end
  130. end
  131. elseif key == "c" and plr.Character.Parent == workspace.Camera and part ~= nil then
  132. local clone = part:Clone()
  133. clone.Parent = workspace
  134. clone.Anchored = false
  135. clone:ClearAllChildren()
  136. clone.CanCollide = true
  137. bp.Parent = clone
  138. particles.Parent = clone
  139. if part.Parent:FindFirstChildOfClass("Humanoid") then
  140. part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false
  141. end
  142. part:Destroy()
  143. part = clone
  144. elseif key == "t" and plr.Character.Parent == workspace.Camera and part == nil then
  145. plr.Character.Parent = workspace
  146. plr.Character.Archivable = false
  147. plr.Character:FindFirstChildOfClass("ForceField"):Remove()
  148. for y,t in pairs(plr.Character:GetChildren()) do
  149. if t:IsA("Part") and t.Name ~= "HumanoidRootPart" then
  150. t.Transparency = 0
  151. if t.Name == "Head" and t:FindFirstChild("face") then
  152. t.face.Transparency = 0
  153. end
  154. elseif t:IsA("Accessory") and t:FindFirstChild("Handle") then
  155. t.Handle.Transparency = 0
  156. end
  157. end
  158. end
  159. end)
  160. mouse.Button1Down:connect(function()
  161. if plr.Character.Parent == workspace.Camera then
  162. if mouse ~= nil then
  163. if mouse.Target ~= nil then
  164. part = mouse.Target
  165. bp = Instance.new("BodyPosition",part)
  166. bp.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  167. bp.Position = part.Position
  168. particles = Instance.new("ParticleEmitter",part)
  169. particles.Color = ColorSequence.new(Color3.new(0,0,0))
  170. particles.Size = NumberSequence.new(1)
  171. particles.Texture = "rbxassetid://292289455"
  172. particles.VelocitySpread = 360
  173. particles.Speed = NumberRange.new(0)
  174. particles.RotSpeed = NumberRange.new(0)
  175. particles.Rotation = NumberRange.new(0)
  176. particles.Rate = 250
  177. particles.Lifetime = NumberRange.new(.2,.4)
  178. particles.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0,1,0),NumberSequenceKeypoint.new(.12,.688,0),NumberSequenceKeypoint.new(.891,.887,0),NumberSequenceKeypoint.new(1,1,0)})
  179. dwn = true
  180. end
  181. end
  182. while dwn == true do
  183. wait()
  184. bp.Position = mouse.hit.p
  185. if part then
  186. if part.Parent:FindFirstChildOfClass("Humanoid") then
  187. part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = true
  188. end
  189. end
  190. end
  191. end
  192. end)
  193. mouse.Button1Up:connect(function()
  194. dwn = false
  195. if part then if part.Parent:FindFirstChildOfClass("Humanoid") then part.Parent:FindFirstChildOfClass("Humanoid").PlatformStand = false end part = nil end
  196. if bp then bp:Destroy() end
  197. if particles then particles:Destroy() end
  198. end)
  199. base = Instance.new("ScreenGui",plr.PlayerGui)
  200. bbg = Instance.new("BillboardGui",plr.Character.Head)
  201. bbg.Size = UDim2.new(0,200,0,50)
  202. bbg.StudsOffset = Vector3.new(0,3,0)
  203. bbgTl = Instance.new("TextLabel",bbg)
  204. bbgTl.BackgroundTransparency = 1
  205. bbgTl.Size = UDim2.new(10,0,1,0)
  206. bbgTl.Position = UDim2.new(-4.5,0,0,0)
  207. bbgTl.Font = "Code"
  208. bbgTl.Text = " "
  209. bbgTl.TextSize = 25
  210. bbgTl.TextStrokeColor3 = Color3.new(1,1,1)
  211. bbgTl.TextColor3 = Color3.new(0,0,0)
  212. bbgTl.TextStrokeTransparency = 0
  213. bbgTl.TextWrapped = true
  214. plr.Chatted:connect(function(msg)
  215. bbgTl.Text = msg
  216. wait(5)
  217. if bbgTl.Text == msg then
  218. bbgTl.Text = " "
  219. end
  220. end)
  221. touchCounter = 0
  222. while wait() do
  223. if plr.Character.Parent == workspace.Camera then
  224. local c = plr.Character:Clone()
  225. c:MakeJoints()
  226. for y,t in pairs(c:GetChildren()) do
  227. if t:IsA("Part") then
  228. t.CanCollide = false
  229. t.Anchored = true
  230. t.Transparency = .5
  231. t.TopSurface = "Smooth"
  232. t.BottomSurface = "Smooth"
  233. t.RightSurface = "Smooth"
  234. t.LeftSurface = "Smooth"
  235. t.FrontSurface = "Smooth"
  236. t.BackSurface = "Smooth"
  237. t.BrickColor = BrickColor.new("Really black")
  238. if t.Name == "Head" and t:FindFirstChild("face") then
  239. t.face:Remove()
  240. elseif t.Name == "Torso" and t:FindFirstChild("roblox") then
  241. t.roblox:Remove()
  242. elseif t.Name == "HumanoidRootPart" then
  243. t:Remove()
  244. end
  245. else
  246. t:Remove()
  247. end
  248. end
  249. c.Parent = workspace
  250. game.Debris:AddItem(c,.05)
  251. end
  252. end
Advertisement
Add Comment
Please, Sign In to add comment