Advertisement
Adog1656

Untitled

Sep 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.88 KB | None | 0 0
  1. --https://github.com/Mokiros/roblox-FE-compatibility
  2. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  3. local Player,game,owner = owner,game
  4. local RealPlayer = Player
  5. do
  6. print("FE Compatibility code by Mokiros")
  7. local rp = RealPlayer
  8. script.Parent = rp.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,Functions={},Connect=function(self,f)table.insert(self.Functions,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(),Button2Up=fakeEvent(),Button2Down=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 then
  34. for _,f in pairs(t.Functions) do
  35. f(...)
  36. end
  37. end
  38. end
  39. m.TrigEvent = te
  40. UIS.TrigEvent = te
  41.  
  42. Event.OnServerEvent:Connect(function(plr,io)
  43. if plr~=rp then return end
  44. m.Target = io.Target
  45. m.Hit = io.Hit
  46. if not io.isMouse then
  47. local b = io.UserInputState == Enum.UserInputState.Begin
  48. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  49. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  50. end
  51. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  52. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  53. end
  54. for _,t in pairs(CAS.Actions) do
  55. for _,k in pairs(t.Keys) do
  56. if k==io.KeyCode then
  57. t.Function(t.Name,io.UserInputState,io)
  58. end
  59. end
  60. end
  61. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  62. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  63. end
  64. end)
  65. Event.Parent = NLS([==[
  66. local Player = game:GetService("Players").LocalPlayer
  67. local Event = script:WaitForChild("UserInput_Event")
  68.  
  69. local Mouse = Player:GetMouse()
  70. local UIS = game:GetService("UserInputService")
  71. local input = function(io,a)
  72. if a then return end
  73. --Since InputObject is a client-side instance, we create and pass table instead
  74. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  75. end
  76. UIS.InputBegan:Connect(input)
  77. UIS.InputEnded:Connect(input)
  78.  
  79. local h,t
  80. --Give the server mouse data 30 times every second, but only if the values changed
  81. --If player is not moving their mouse, client won't fire events
  82. while wait(1/30) do
  83. if h~=Mouse.Hit or t~=Mouse.Target then
  84. h,t=Mouse.Hit,Mouse.Target
  85. Event:FireServer({isMouse=true,Target=t,Hit=h})
  86. end
  87. end]==],Player.Character)
  88.  
  89. ----Sandboxed game object that allows the usage of client-side methods and services
  90. --Real game object
  91. local _rg = game
  92.  
  93. --Metatable for fake service
  94. local fsmt = {
  95. __index = function(self,k)
  96. local s = rawget(self,"_RealService")
  97. if s then
  98. return typeof(s[k])=="function"
  99. and function(_,...)return s[k](s,...)end or s[k]
  100. end
  101. end,
  102. __newindex = function(self,k,v)
  103. local s = rawget(self,"_RealService")
  104. if s then s[k]=v end
  105. end
  106. }
  107. local function FakeService(t,RealService)
  108. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  109. return setmetatable(t,fsmt)
  110. end
  111.  
  112. --Fake game object
  113. local g = {
  114. GetService = function(self,s)
  115. return rawget(self,s) or _rg:GetService(s)
  116. end,
  117. Players = FakeService({
  118. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  119. },"Players"),
  120. UserInputService = FakeService(UIS,"UserInputService"),
  121. ContextActionService = FakeService(CAS,"ContextActionService"),
  122. RunService = FakeService({
  123. _btrs = {},
  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. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  134. g.service = g.GetService
  135. FakeService(g,game)
  136. --Changing owner to fake player object to support owner:GetMouse()
  137. game,owner = g,g.Players.LocalPlayer
  138. end
  139. --Left Click to kill yourself
  140.  
  141. local player = game.Players.LocalPlayer
  142. repeat wait() until player.Character.Humanoid
  143. local humanoid = player.Character.Humanoid
  144. local mouse = player:GetMouse()
  145. --game.Players.LocalPlayer.Character.Shirt.ShirtTemplate='rbxassetid://473465498'
  146. local player=game.Players.LocalPlayer;
  147. local char=game.Players.LocalPlayer.Character;
  148. local humanoid = player.Character.Humanoid;
  149. Tool=Instance.new('Tool', game.Players.LocalPlayer.Backpack);
  150. Tool.GripRight=Vector3.new(-0.816, 0, 0.577);
  151. Tool.GripUp=Vector3.new(-0.027, 0.996, -0.089);
  152. Tool.GripPos=Vector3.new(-0.3, -0.4, 0.4);
  153. Tool.GripForward=Vector3.new(-1, 0, -0); --0.485, 0.14, -0.863
  154. Tool.Name='kys';
  155. Handle=Instance.new('Part', Tool);
  156. Handle.Name = 'Handle';
  157. Handle.BrickColor=BrickColor.new('Really black')
  158. Handle.Size=Vector3.new(0.26, 1.11, 4.85);
  159. Handle.Position=Vector3.new(-18.53, 0.555, -16.825)
  160. gunfire=Instance.new('Part', Tool)
  161. gunfire.Name='GunFire'
  162. gunfire.Size=Vector3.new(0.2, 0.2, 0.2)
  163. gunfire.Transparency=1
  164. gunfire.Position=Vector3.new(-18.56, 1.1, -19.35)
  165. gunfirefx=Instance.new('BillboardGui', gunfire)
  166. gunfirefx.Enabled=false
  167. gunfirefx.Adornee = gunfire
  168. gunfirefx.Size=UDim2.new(1.1, 0, 1.1, 0)
  169. gunfirefx2=Instance.new('ImageLabel', gunfirefx)
  170. gunfirefx2.Image='http://www.roblox.com/asset/?id=117472237'
  171. gunfirefx2.BackgroundTransparency=1
  172. gunfirefx2.Size=UDim2.new(1.2, 0, 1.2, 0)
  173.  
  174. shootsound=Instance.new('Sound', char.Torso)
  175. shootsound.Volume=8
  176. shootsound.SoundId='rbxassetid://230622620'
  177. c4mesh=Instance.new('SpecialMesh', Handle);
  178. c4mesh.MeshType = 'FileMesh';
  179. c4mesh.MeshId='http://www.roblox.com/asset/?id=95356090';
  180. c4mesh.TextureId='http://www.roblox.com/asset/?id=95387789';
  181. c4mesh.Scale=Vector3.new(1.8, 1.8, 1.8);
  182.  
  183. local anim5 = Instance.new("Animation", player.Character)
  184. anim5.AnimationId = "http://www.roblox.com/asset/?id=95383474"
  185. local playAnim10 = humanoid:LoadAnimation(anim5)
  186.  
  187. Tool.GripRight=Vector3.new(-0.816, 0, 0.577)
  188.  
  189. function equipped()
  190. wait()
  191. playAnim10:Play()
  192. end
  193.  
  194. function unequipped()
  195. wait()
  196. playAnim10:Stop()
  197. end
  198.  
  199. Tool.Equipped:connect(equipped)
  200. Tool.Unequipped:connect(unequipped)
  201.  
  202. light=Instance.new('PointLight', Handle);
  203. light.Color = Color3.new(255, 255, 0)
  204. light.Range=10;
  205. light.Enabled=false;
  206.  
  207.  
  208. function Shoot()
  209. shootsound:Play()
  210. light.Enabled=true
  211. wait(0.1)
  212. light.Enabled=false
  213. player.Character.Humanoid.Health=0
  214. wait()
  215. Tool:Destroy()
  216. end
  217. Tool.Activated:connect(Shoot)
  218.  
  219. --ragdoll
  220.  
  221. print("Loaded.")
  222. --You don't need to edit this!
  223.  
  224. Character = player.Character
  225. Humanoid = Character.Humanoid
  226. Torso = Character.Torso
  227. mode = Instance.new("Model")
  228. mode.Name = ""
  229. mode.Parent = game.Workspace
  230.  
  231. function OnDeath()
  232.  
  233. print("Death")
  234. wait(0.00000001)
  235. Humanoid.Parent = nil
  236. if Torso then
  237. zam=Torso:Clone()
  238. zam.Parent=mode
  239. x=Character:GetChildren()
  240. for i=1,#x do
  241. if ((x[i].Name=="Shirt") or (x[i].Name=="Pants")) then
  242. local zor=x[i]:Clone()
  243. zor.Parent=mode
  244. end
  245. if x[i].Name=="Head" then
  246. local zem=x[i]:Clone()
  247. zem.Parent=mode --Made by MatrixComplexity
  248. local Neck = Instance.new("Weld")
  249. Neck.Name = "Neck"
  250. Neck.Part0 = zam
  251. Neck.Part1 = zem
  252. Neck.C0 = CFrame.new(0, 1.5, 0)
  253. Neck.C1 = CFrame.new()
  254. Neck.Parent = zam
  255. end
  256. if x[i].Name=="Right Arm" then
  257. local Limb=x[i]:Clone()
  258. Limb.Parent=mode
  259. Limb.CFrame = zam.CFrame * CFrame.new(1.5, 0, 0)
  260. local Joint = Instance.new("Glue")
  261. Joint.Name = "RightShoulder"
  262. Joint.Part0 = zam
  263. Joint.Part1 = Limb
  264. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  265. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  266. Joint.Parent = zam
  267.  
  268. local B = Instance.new("Part")
  269. B.TopSurface = 0
  270. B.BottomSurface = 0
  271. B.formFactor = "Symmetric"
  272. B.Size = Vector3.new(1, 1, 1)
  273. B.Transparency = 1
  274. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  275. B.Parent = mode
  276. local W = Instance.new("Weld")
  277. W.Part0 = Limb
  278. W.Part1 = B
  279. W.C0 = CFrame.new(0, -0.5, 0)
  280. W.Parent = Limb
  281.  
  282. end
  283. if x[i].Name=="Left Arm" then
  284. local Limb=x[i]:Clone()
  285. Limb.Parent=mode
  286.  
  287. Limb.CFrame = zam.CFrame * CFrame.new(-1.5, 0, 0)
  288. local Joint = Instance.new("Glue")
  289. Joint.Name = "LeftShoulder"
  290. Joint.Part0 = zam
  291. Joint.Part1 = Limb
  292. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  293. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  294. Joint.Parent = zam
  295.  
  296. local B = Instance.new("Part")
  297. B.TopSurface = 0
  298. B.BottomSurface = 0
  299. B.formFactor = "Symmetric"
  300. B.Size = Vector3.new(1, 1, 1)
  301. B.Transparency = 1
  302. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  303. B.Parent = mode
  304. local W = Instance.new("Weld")
  305. W.Part0 = Limb
  306. W.Part1 = B
  307. W.C0 = CFrame.new(0, -0.5, 0)
  308. W.Parent = Limb
  309.  
  310. end
  311. if x[i].Name=="Right Leg" then
  312. local Limb=x[i]:Clone()
  313. Limb.Parent=mode
  314.  
  315. Limb.CFrame = zam.CFrame * CFrame.new(0.5, -2, 0)
  316. local Joint = Instance.new("Glue")
  317. Joint.Name = "RightHip"
  318. Joint.Part0 = zam
  319. Joint.Part1 = Limb
  320. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  321. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  322. Joint.Parent = zam
  323.  
  324. local B = Instance.new("Part")
  325. B.TopSurface = 0
  326. B.BottomSurface = 0
  327. B.formFactor = "Symmetric"
  328. B.Size = Vector3.new(1, 1, 1)
  329. B.Transparency = 1
  330. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  331. B.Parent = mode
  332. local W = Instance.new("Weld")
  333. W.Part0 = Limb
  334. W.Part1 = B
  335. W.C0 = CFrame.new(0, -0.5, 0)
  336. W.Parent = Limb
  337.  
  338. end
  339. if x[i].Name=="Left Leg" then
  340. local Limb=x[i]:Clone()
  341. Limb.Parent=mode
  342.  
  343. Limb.CFrame = zam.CFrame * CFrame.new(-0.5, -2, 0)
  344. local Joint = Instance.new("Glue")
  345. Joint.Name = "LeftHip"
  346. Joint.Part0 = zam
  347. Joint.Part1 = Limb
  348. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  349. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  350. Joint.Parent = zam
  351.  
  352. local B = Instance.new("Part")
  353. B.TopSurface = 0
  354. B.BottomSurface = 0
  355. B.formFactor = "Symmetric"
  356. B.Size = Vector3.new(1, 1, 1)
  357. B.Transparency = 1
  358. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  359. B.Parent = mode
  360. local W = Instance.new("Weld")
  361. W.Part0 = Limb
  362. W.Part1 = B
  363. W.C0 = CFrame.new(0, -0.5, 0)
  364. W.Parent = Limb
  365.  
  366. end
  367. bland=Instance.new("Humanoid")
  368. bland.Health = 0
  369. bland.MaxHealth = 0
  370. bland.Parent=mode
  371. if ((x[i].Name=="Shirt") or (x[i].Name=="Pants")) then
  372. local zor=x[i]:Clone()
  373. zor.Parent=mode
  374. end
  375. --[
  376. if (x[i].ClassName=="CharacterMesh") then
  377. local zor=x[i]:Clone()
  378. zor.Parent=mode
  379. end
  380. if (x[i].ClassName=="Hat") then
  381. local zor=x[i]:Clone()
  382. zor.Parent=mode
  383. end
  384. local cam = Instance.new("Camera")
  385. cam.Parent = game.Players:FindFirstChild(Character.Name)
  386. cam.CameraSubject = mode.Humanoid
  387. local Bar = Instance.new("Part")
  388. Bar.TopSurface = 0
  389. Bar.BottomSurface = 0
  390. Bar.formFactor = "Symmetric"
  391. Bar.Size = Vector3.new(1, 1, 1)
  392. Bar.Transparency = 1
  393. Bar.CFrame = zam.CFrame * CFrame.new(0, 0.5, 0)
  394. Bar.Parent = mode
  395. local Weld = Instance.new("Weld")
  396. Weld.Part0 = zam
  397. Weld.Part1 = Bar
  398. Weld.C0 = CFrame.new(0, 0.5, 0)
  399. Weld.Parent = zam
  400. --]]
  401. end
  402. end
  403. wait()
  404. Character:Remove()
  405. wait(6)
  406. mode:Destroy()
  407. end
  408.  
  409. Humanoid.Died:connect(OnDeath)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement