Advertisement
Adog1656

Untitled

Sep 23rd, 2018
85
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.  
  140. --Left Click to kill yourself
  141.  
  142. local player = game.Players.LocalPlayer
  143. repeat wait() until player.Character.Humanoid
  144. local humanoid = player.Character.Humanoid
  145. local mouse = player:GetMouse()
  146. --game.Players.LocalPlayer.Character.Shirt.ShirtTemplate='rbxassetid://473465498'
  147. local player=game.Players.LocalPlayer;
  148. local char=game.Players.LocalPlayer.Character;
  149. local humanoid = player.Character.Humanoid;
  150. Tool=Instance.new('Tool', game.Players.LocalPlayer.Backpack);
  151. Tool.GripRight=Vector3.new(-0.816, 0, 0.577);
  152. Tool.GripUp=Vector3.new(-0.027, 0.996, -0.089);
  153. Tool.GripPos=Vector3.new(-0.3, -0.4, 0.4);
  154. Tool.GripForward=Vector3.new(-1, 0, -0); --0.485, 0.14, -0.863
  155. Tool.Name='kys';
  156. Handle=Instance.new('Part', Tool);
  157. Handle.Name = 'Handle';
  158. Handle.BrickColor=BrickColor.new('Really black')
  159. Handle.Size=Vector3.new(0.26, 1.11, 4.85);
  160. Handle.Position=Vector3.new(-18.53, 0.555, -16.825)
  161. gunfire=Instance.new('Part', Tool)
  162. gunfire.Name='GunFire'
  163. gunfire.Size=Vector3.new(0.2, 0.2, 0.2)
  164. gunfire.Transparency=1
  165. gunfire.Position=Vector3.new(-18.56, 1.1, -19.35)
  166. gunfirefx=Instance.new('BillboardGui', gunfire)
  167. gunfirefx.Enabled=false
  168. gunfirefx.Adornee = gunfire
  169. gunfirefx.Size=UDim2.new(1.1, 0, 1.1, 0)
  170. gunfirefx2=Instance.new('ImageLabel', gunfirefx)
  171. gunfirefx2.Image='http://www.roblox.com/asset/?id=117472237'
  172. gunfirefx2.BackgroundTransparency=1
  173. gunfirefx2.Size=UDim2.new(1.2, 0, 1.2, 0)
  174.  
  175. shootsound=Instance.new('Sound', char.Torso)
  176. shootsound.Volume=8
  177. shootsound.SoundId='rbxassetid://230622620'
  178. c4mesh=Instance.new('SpecialMesh', Handle);
  179. c4mesh.MeshType = 'FileMesh';
  180. c4mesh.MeshId='http://www.roblox.com/asset/?id=95356090';
  181. c4mesh.TextureId='http://www.roblox.com/asset/?id=95387789';
  182. c4mesh.Scale=Vector3.new(1.8, 1.8, 1.8);
  183.  
  184. local anim5 = Instance.new("Animation", player.Character)
  185. anim5.AnimationId = "http://www.roblox.com/asset/?id=95383474"
  186. local playAnim10 = humanoid:LoadAnimation(anim5)
  187.  
  188. Tool.GripRight=Vector3.new(-0.816, 0, 0.577)
  189.  
  190. function equipped()
  191. wait()
  192. playAnim10:Play()
  193. end
  194.  
  195. function unequipped()
  196. wait()
  197. playAnim10:Stop()
  198. end
  199.  
  200. Tool.Equipped:connect(equipped)
  201. Tool.Unequipped:connect(unequipped)
  202.  
  203. light=Instance.new('PointLight', Handle);
  204. light.Color = Color3.new(255, 255, 0)
  205. light.Range=10;
  206. light.Enabled=false;
  207.  
  208.  
  209. function Shoot()
  210. shootsound:Play()
  211. light.Enabled=true
  212. wait(0.1)
  213. light.Enabled=false
  214. player.Character.Humanoid.Health=0
  215. wait()
  216. Tool:Destroy()
  217. end
  218. Tool.Activated:connect(Shoot)
  219.  
  220. --ragdoll
  221.  
  222. print("Loaded.")
  223. --You don't need to edit this!
  224.  
  225. Character = player.Character
  226. Humanoid = Character.Humanoid
  227. Torso = Character.Torso
  228. mode = Instance.new("Model")
  229. mode.Name = ""
  230. mode.Parent = game.Workspace
  231.  
  232. function OnDeath()
  233.  
  234. print("Death")
  235. wait(0.00000001)
  236. Humanoid.Parent = nil
  237. if Torso then
  238. zam=Torso:Clone()
  239. zam.Parent=mode
  240. x=Character:GetChildren()
  241. for i=1,#x do
  242. if ((x[i].Name=="Shirt") or (x[i].Name=="Pants")) then
  243. local zor=x[i]:Clone()
  244. zor.Parent=mode
  245. end
  246. if x[i].Name=="Head" then
  247. local zem=x[i]:Clone()
  248. zem.Parent=mode --Made by MatrixComplexity
  249. local Neck = Instance.new("Weld")
  250. Neck.Name = "Neck"
  251. Neck.Part0 = zam
  252. Neck.Part1 = zem
  253. Neck.C0 = CFrame.new(0, 1.5, 0)
  254. Neck.C1 = CFrame.new()
  255. Neck.Parent = zam
  256. end
  257. if x[i].Name=="Right Arm" then
  258. local Limb=x[i]:Clone()
  259. Limb.Parent=mode
  260. Limb.CFrame = zam.CFrame * CFrame.new(1.5, 0, 0)
  261. local Joint = Instance.new("Glue")
  262. Joint.Name = "RightShoulder"
  263. Joint.Part0 = zam
  264. Joint.Part1 = Limb
  265. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  266. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  267. Joint.Parent = zam
  268.  
  269. local B = Instance.new("Part")
  270. B.TopSurface = 0
  271. B.BottomSurface = 0
  272. B.formFactor = "Symmetric"
  273. B.Size = Vector3.new(1, 1, 1)
  274. B.Transparency = 1
  275. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  276. B.Parent = mode
  277. local W = Instance.new("Weld")
  278. W.Part0 = Limb
  279. W.Part1 = B
  280. W.C0 = CFrame.new(0, -0.5, 0)
  281. W.Parent = Limb
  282.  
  283. end
  284. if x[i].Name=="Left Arm" then
  285. local Limb=x[i]:Clone()
  286. Limb.Parent=mode
  287.  
  288. Limb.CFrame = zam.CFrame * CFrame.new(-1.5, 0, 0)
  289. local Joint = Instance.new("Glue")
  290. Joint.Name = "LeftShoulder"
  291. Joint.Part0 = zam
  292. Joint.Part1 = Limb
  293. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  294. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  295. Joint.Parent = zam
  296.  
  297. local B = Instance.new("Part")
  298. B.TopSurface = 0
  299. B.BottomSurface = 0
  300. B.formFactor = "Symmetric"
  301. B.Size = Vector3.new(1, 1, 1)
  302. B.Transparency = 1
  303. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  304. B.Parent = mode
  305. local W = Instance.new("Weld")
  306. W.Part0 = Limb
  307. W.Part1 = B
  308. W.C0 = CFrame.new(0, -0.5, 0)
  309. W.Parent = Limb
  310.  
  311. end
  312. if x[i].Name=="Right Leg" then
  313. local Limb=x[i]:Clone()
  314. Limb.Parent=mode
  315.  
  316. Limb.CFrame = zam.CFrame * CFrame.new(0.5, -2, 0)
  317. local Joint = Instance.new("Glue")
  318. Joint.Name = "RightHip"
  319. Joint.Part0 = zam
  320. Joint.Part1 = Limb
  321. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  322. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  323. Joint.Parent = zam
  324.  
  325. local B = Instance.new("Part")
  326. B.TopSurface = 0
  327. B.BottomSurface = 0
  328. B.formFactor = "Symmetric"
  329. B.Size = Vector3.new(1, 1, 1)
  330. B.Transparency = 1
  331. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  332. B.Parent = mode
  333. local W = Instance.new("Weld")
  334. W.Part0 = Limb
  335. W.Part1 = B
  336. W.C0 = CFrame.new(0, -0.5, 0)
  337. W.Parent = Limb
  338.  
  339. end
  340. if x[i].Name=="Left Leg" then
  341. local Limb=x[i]:Clone()
  342. Limb.Parent=mode
  343.  
  344. Limb.CFrame = zam.CFrame * CFrame.new(-0.5, -2, 0)
  345. local Joint = Instance.new("Glue")
  346. Joint.Name = "LeftHip"
  347. Joint.Part0 = zam
  348. Joint.Part1 = Limb
  349. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  350. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  351. Joint.Parent = zam
  352.  
  353. local B = Instance.new("Part")
  354. B.TopSurface = 0
  355. B.BottomSurface = 0
  356. B.formFactor = "Symmetric"
  357. B.Size = Vector3.new(1, 1, 1)
  358. B.Transparency = 1
  359. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  360. B.Parent = mode
  361. local W = Instance.new("Weld")
  362. W.Part0 = Limb
  363. W.Part1 = B
  364. W.C0 = CFrame.new(0, -0.5, 0)
  365. W.Parent = Limb
  366.  
  367. end
  368. bland=Instance.new("Humanoid")
  369. bland.Health = 0
  370. bland.MaxHealth = 0
  371. bland.Parent=mode
  372. if ((x[i].Name=="Shirt") or (x[i].Name=="Pants")) then
  373. local zor=x[i]:Clone()
  374. zor.Parent=mode
  375. end
  376. --[
  377. if (x[i].ClassName=="CharacterMesh") then
  378. local zor=x[i]:Clone()
  379. zor.Parent=mode
  380. end
  381. if (x[i].ClassName=="Hat") then
  382. local zor=x[i]:Clone()
  383. zor.Parent=mode
  384. end
  385. local cam = Instance.new("Camera")
  386. cam.Parent = game.Players:FindFirstChild(Character.Name)
  387. cam.CameraSubject = mode.Humanoid
  388. local Bar = Instance.new("Part")
  389. Bar.TopSurface = 0
  390. Bar.BottomSurface = 0
  391. Bar.formFactor = "Symmetric"
  392. Bar.Size = Vector3.new(1, 1, 1)
  393. Bar.Transparency = 1
  394. Bar.CFrame = zam.CFrame * CFrame.new(0, 0.5, 0)
  395. Bar.Parent = mode
  396. local Weld = Instance.new("Weld")
  397. Weld.Part0 = zam
  398. Weld.Part1 = Bar
  399. Weld.C0 = CFrame.new(0, 0.5, 0)
  400. Weld.Parent = zam
  401. --]]
  402. end
  403. end
  404. wait()
  405. Character:Remove()
  406. wait(6)
  407. mode:Destroy()
  408. end
  409.  
  410. Humanoid.Died:connect(OnDeath)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement