Advertisement
AsukaOS

Test-4

Oct 12th, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.05 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 V2 by Mokiros")
  7. local RealPlayer = RealPlayer
  8. script.Parent = RealPlayer.Character
  9.  
  10. --Fake event to make stuff like Mouse.KeyDown work
  11. local Disconnect_Function = function(this)
  12. this[1].Functions[this[2]] = nil
  13. end
  14. local Disconnect_Metatable = {__index={disconnect=Disconnect_Function,Disconnect=Disconnect_Function}}
  15. local FakeEvent_Metatable = {__index={
  16. Connect = function(this,f)
  17. local i = tostring(math.random(0,10000))
  18. while this.Functions[i] do
  19. i = tostring(math.random(0,10000))
  20. end
  21. this.Functions[i] = f
  22. return setmetatable({this,i},Disconnect_Metatable)
  23. end
  24. }}
  25. FakeEvent_Metatable.__index.connect = FakeEvent_Metatable.__index.Connect
  26. local function fakeEvent()
  27. return setmetatable({Functions={}},FakeEvent_Metatable)
  28. end
  29.  
  30. --Creating fake input objects with fake variables
  31. local FakeMouse = {Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  32. FakeMouse.keyUp = FakeMouse.KeyUp
  33. FakeMouse.keyDown = FakeMouse.KeyDown
  34. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  35. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  36. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  37. end}
  38. --Merged 2 functions into one by checking amount of arguments
  39. CAS.UnbindAction = CAS.BindAction
  40.  
  41. --This function will trigger the events that have been :Connect()'ed
  42. local function TriggerEvent(self,ev,...)
  43. for _,f in pairs(self[ev].Functions) do
  44. f(...)
  45. end
  46. end
  47. FakeMouse.TriggerEvent = TriggerEvent
  48. UIS.TriggerEvent = TriggerEvent
  49.  
  50. --Client communication
  51. local Event = Instance.new("RemoteEvent")
  52. Event.Name = "UserInput_Event"
  53. Event.OnServerEvent:Connect(function(plr,io)
  54. if plr~=RealPlayer then return end
  55. FakeMouse.Target = io.Target
  56. FakeMouse.Hit = io.Hit
  57. if not io.isMouse then
  58. local b = io.UserInputState == Enum.UserInputState.Begin
  59. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  60. return FakeMouse:TriggerEvent(b and "Button1Down" or "Button1Up")
  61. end
  62. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  63. return FakeMouse:TriggerEvent(b and "Button2Down" or "Button2Up")
  64. end
  65. for _,t in pairs(CAS.Actions) do
  66. for _,k in pairs(t.Keys) do
  67. if k==io.KeyCode then
  68. t.Function(t.Name,io.UserInputState,io)
  69. end
  70. end
  71. end
  72. FakeMouse:TriggerEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  73. UIS:TriggerEvent(b and "InputBegan" or "InputEnded",io,false)
  74. end
  75. end)
  76. Event.Parent = NLS([==[local Event = script:WaitForChild("UserInput_Event")
  77. local Mouse = owner:GetMouse()
  78. local UIS = game:GetService("UserInputService")
  79. local input = function(io,RobloxHandled)
  80. if RobloxHandled then return end
  81. --Since InputObject is a client-side instance, we create and pass table instead
  82. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  83. end
  84. UIS.InputBegan:Connect(input)
  85. UIS.InputEnded:Connect(input)
  86.  
  87. local h,t
  88. --Give the server mouse data every second frame, but only if the values changed
  89. --If player is not moving their mouse, client won't fire events
  90. local HB = game:GetService("RunService").Heartbeat
  91. while true do
  92. if h~=Mouse.Hit or t~=Mouse.Target then
  93. h,t=Mouse.Hit,Mouse.Target
  94. Event:FireServer({isMouse=true,Target=t,Hit=h})
  95. end
  96. --Wait 2 frames
  97. for i=1,2 do
  98. HB:Wait()
  99. end
  100. end]==],script)
  101.  
  102. ----Sandboxed game object that allows the usage of client-side methods and services
  103. --Real game object
  104. local RealGame = game
  105.  
  106. --Metatable for fake service
  107. local FakeService_Metatable = {
  108. __index = function(self,k)
  109. local s = rawget(self,"_RealService")
  110. if s then
  111. return typeof(s[k])=="function"
  112. and function(_,...)return s[k](s,...)end or s[k]
  113. end
  114. end,
  115. __newindex = function(self,k,v)
  116. local s = rawget(self,"_RealService")
  117. if s then s[k]=v end
  118. end
  119. }
  120. local function FakeService(t,RealService)
  121. t._RealService = typeof(RealService)=="string" and RealGame:GetService(RealService) or RealService
  122. return setmetatable(t,FakeService_Metatable)
  123. end
  124.  
  125. --Fake game object
  126. local FakeGame = {
  127. GetService = function(self,s)
  128. return rawget(self,s) or RealGame:GetService(s)
  129. end,
  130. Players = FakeService({
  131. LocalPlayer = FakeService({GetMouse=function(self)return FakeMouse end},Player)
  132. },"Players"),
  133. UserInputService = FakeService(UIS,"UserInputService"),
  134. ContextActionService = FakeService(CAS,"ContextActionService"),
  135. RunService = FakeService({
  136. _btrs = {},
  137. RenderStepped = RealGame:GetService("RunService").Heartbeat,
  138. BindToRenderStep = function(self,name,_,fun)
  139. self._btrs[name] = self.Heartbeat:Connect(fun)
  140. end,
  141. UnbindFromRenderStep = function(self,name)
  142. self._btrs[name]:Disconnect()
  143. end,
  144. },"RunService")
  145. }
  146. rawset(FakeGame.Players,"localPlayer",FakeGame.Players.LocalPlayer)
  147. FakeGame.service = FakeGame.GetService
  148. FakeService(FakeGame,game)
  149. --Changing owner to fake player object to support owner:GetMouse()
  150. game,owner = FakeGame,FakeGame.Players.LocalPlayer
  151. end
  152. --By Rufus14 lolol
  153. --Converted with ttyyuu12345's model to script plugin v4
  154. function sandbox(var,func)
  155. local env = getfenv(func)
  156. local newenv = setmetatable({},{
  157. __index = function(self,k)
  158. if k=="script" then
  159. return var
  160. else
  161. return env[k]
  162. end
  163. end,
  164. })
  165. setfenv(func,newenv)
  166. return func
  167. end
  168. cors = {}
  169. mas = Instance.new("Model",game:GetService("Lighting"))
  170. Part0 = Instance.new("Part")
  171. Sound1 = Instance.new("Sound")
  172. Attachment2 = Instance.new("Attachment")
  173. RopeConstraint3 = Instance.new("RopeConstraint")
  174. Part4 = Instance.new("Part")
  175. SpecialMesh5 = Instance.new("SpecialMesh")
  176. Attachment6 = Instance.new("Attachment")
  177. RopeConstraint7 = Instance.new("RopeConstraint")
  178. RopeConstraint8 = Instance.new("RopeConstraint")
  179. Part0.Parent = mas
  180. Part0.BrickColor = BrickColor.new("Pearl")
  181. Part0.Anchored = true
  182. Part0.Size = Vector3.new(9.97000027, 0.720000267, 7.03999949)
  183. Part0.CFrame = CFrame.new(16.7149887, 13.7606668, 36.7299957, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  184. Part0.BottomSurface = Enum.SurfaceType.Smooth
  185. Part0.TopSurface = Enum.SurfaceType.Smooth
  186. Part0.Color = Color3.new(0.905882, 0.905882, 0.92549)
  187. Part0.Position = Vector3.new(16.7149887, 13.7606668, 36.7299957)
  188. Part0.Color = Color3.new(0.905882, 0.905882, 0.92549)
  189. Sound1.Parent = Part0
  190. Sound1.SoundId = "rbxassetid://1205183071"
  191. Attachment6.Parent = Part0
  192. Attachment6.Visible = true
  193. RopeConstraint8.Parent = Attachment6
  194. RopeConstraint8.Color = BrickColor.new("Maroon")
  195. RopeConstraint8.Visible = true
  196. RopeConstraint8.Attachment0 = nil
  197. RopeConstraint8.Attachment1 = Attachment6
  198. RopeConstraint8.Color = BrickColor.new("Maroon")
  199. RopeConstraint8.Length = 7.5
  200. RopeConstraint8.Thickness = 0.20000000298023
  201. RopeConstraint8.Restitution = 0.10000000149012
  202. Part4.Parent = mas
  203. Part4.Size = Vector3.new(3.6299994, 2.9199996, 2.94999957)
  204. Part4.CFrame = CFrame.new(16.4487038, 1.47368073, 36.9643707, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  205. Part4.BottomSurface = Enum.SurfaceType.Smooth
  206. Part4.TopSurface = Enum.SurfaceType.Smooth
  207. Part4.Position = Vector3.new(16.4487038, 1.47368073, 36.9643707)
  208. SpecialMesh5.Parent = Part4
  209. SpecialMesh5.MeshId = "http://www.roblox.com/asset/?id=112335925"
  210. SpecialMesh5.Scale = Vector3.new(3, 3, 3)
  211. SpecialMesh5.TextureId = "http://www.roblox.com/asset/?id=112335881"
  212. SpecialMesh5.MeshType = Enum.MeshType.FileMesh
  213. SpecialMesh5.Scale = Vector3.new(3, 3, 3)
  214. Attachment6.Parent = Part0
  215. Attachment6.Visible = true
  216. RopeConstraint8.Parent = Attachment6
  217. RopeConstraint8.Color = BrickColor.new("Maroon")
  218. RopeConstraint8.Visible = true
  219. RopeConstraint8.Length = 7.5
  220. RopeConstraint8.Thickness = 0.20000000298023
  221. RopeConstraint8.Restitution = 0
  222. for i,v in pairs(mas:GetChildren()) do
  223. v.Parent = game:GetService("Players").LocalPlayer.Character
  224. pcall(function() v:MakeJoints() end)
  225. end
  226. mas:Destroy()
  227. for i,v in pairs(cors) do
  228. spawn(function()
  229. pcall(v)
  230. end)
  231. end
  232. Part0.CFrame = game.Players.LocalPlayer.Character.Head.CFrame * CFrame.new(0,7.5,0)
  233. game.Players.LocalPlayer.Character.Torso.CFrame = game.Players.LocalPlayer.Character.Torso.CFrame * CFrame.new(0,2,0)
  234. Part4.CFrame = game.Players.LocalPlayer.Character.Torso.CFrame * CFrame.new(0,-3,0)
  235. RopeConstraint8.Attachment0 = game.Players.LocalPlayer.Character.Torso.NeckAttachment
  236. RopeConstraint8.Attachment1 = Attachment6
  237. RopeConstraint8.Visible = true
  238. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0
  239. game.Players.LocalPlayer.Character.Humanoid.JumpPower = 0
  240. -- Objects
  241.  
  242. local ScreenGui = Instance.new("ScreenGui")
  243. local TextButton = Instance.new("TextButton")
  244.  
  245. -- Properties
  246.  
  247. ScreenGui.Parent = game.Players.LocalPlayer.PlayerGui
  248.  
  249. TextButton.Parent = ScreenGui
  250. TextButton.BackgroundColor3 = Color3.new(1, 1, 1)
  251. TextButton.Position = UDim2.new(0.318378747, 0, 0.816154361, 0)
  252. TextButton.Size = UDim2.new(0, 496, 0, 135)
  253. TextButton.Style = Enum.ButtonStyle.RobloxRoundDefaultButton
  254. TextButton.Font = Enum.Font.SourceSans
  255. TextButton.FontSize = Enum.FontSize.Size14
  256. TextButton.Text = "Suicide"
  257. TextButton.TextColor3 = Color3.new(0.454902, 0, 0)
  258. TextButton.TextScaled = true
  259. TextButton.TextSize = 14
  260. TextButton.TextWrapped = true
  261. function kys()
  262. ScreenGui:destroy()
  263. local bodyvel = Instance.new("BodyVelocity", Part4)
  264. bodyvel.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 45
  265. local death = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  266. death.Volume = 10
  267. death.SoundId = "rbxassetid://12222242"
  268. wait(0.2)
  269. death:Play()
  270. bodyvel:destroy()
  271. game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true
  272. if game.Players.LocalPlayer.Character:findFirstChild("Torso") then
  273. game.Players.LocalPlayer.Character.Torso.Velocity = game.Players.LocalPlayer.Character.Torso.CFrame.lookVector * 10
  274. for i,v in pairs(game.Players.LocalPlayer.Character.Torso:GetChildren()) do
  275. if v.ClassName == "Motor6D" then
  276. if v.Name == "Neck" then
  277.  
  278. else
  279. v:destroy()
  280. end
  281. end
  282. end
  283. end
  284. if game.Players.LocalPlayer.Character:findFirstChild("Right Arm") then
  285. local attachment = Instance.new("Attachment", game.Players.LocalPlayer.Character.Torso)
  286. attachment.Position = Vector3.new(1, 1, 0)
  287. local ball = Instance.new("BallSocketConstraint", game.Players.LocalPlayer.Character)
  288. ball.Attachment0 = game.Players.LocalPlayer.Character["Right Arm"].RightShoulderAttachment
  289. ball.Attachment1 = attachment
  290. local collidepartofleftleg = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  291. collidepartofleftleg.Name = "Bone"
  292. collidepartofleftleg.Size = Vector3.new(0.8,1.4,0.8)
  293. collidepartofleftleg.Transparency = 1
  294. collidepartofleftleg:BreakJoints()
  295. local weeld = Instance.new("Weld", collidepartofleftleg)
  296. weeld.Part0 = game.Players.LocalPlayer.Character["Right Arm"]
  297. weeld.Part1 = collidepartofleftleg
  298. weeld.C0 = weeld.C0 * CFrame.new(0,-0.3,0)
  299. end
  300. if game.Players.LocalPlayer.Character:findFirstChild("Left Arm") then
  301. local attachment = Instance.new("Attachment", game.Players.LocalPlayer.Character.Torso)
  302. attachment.Position = Vector3.new(-1, 1, 0)
  303. local ball = Instance.new("BallSocketConstraint", game.Players.LocalPlayer.Character)
  304. ball.Attachment0 = attachment
  305. ball.Attachment1 = game.Players.LocalPlayer.Character["Left Arm"].LeftShoulderAttachment
  306. local collidepartofleftleg = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  307. collidepartofleftleg.Name = "Bone"
  308. collidepartofleftleg.Size = Vector3.new(0.8,1.4,0.8)
  309. collidepartofleftleg.Transparency = 1
  310. collidepartofleftleg:BreakJoints()
  311. local weeld = Instance.new("Weld", collidepartofleftleg)
  312. weeld.Part0 = game.Players.LocalPlayer.Character["Left Arm"]
  313. weeld.Part1 = collidepartofleftleg
  314. weeld.C0 = weeld.C0 * CFrame.new(0,-0.3,0)
  315. end
  316. if game.Players.LocalPlayer.Character:findFirstChild("Right Leg") then
  317. local attachment = Instance.new("Attachment", game.Players.LocalPlayer.Character.Torso)
  318. attachment.Position = Vector3.new(0.5, -1, 0)
  319. local ball = Instance.new("BallSocketConstraint", game.Players.LocalPlayer.Character)
  320. ball.Attachment0 = game.Players.LocalPlayer.Character["Right Leg"].RightFootAttachment
  321. ball.Attachment1 = attachment
  322. game.Players.LocalPlayer.Character["Right Leg"].RightFootAttachment.Position = Vector3.new(0, 1, 0)
  323. local collidepartofleftleg = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  324. collidepartofleftleg.Name = "Bone"
  325. collidepartofleftleg.Size = Vector3.new(0.8,1.4,0.8)
  326. collidepartofleftleg.Transparency = 1
  327. collidepartofleftleg:BreakJoints()
  328. local weeld = Instance.new("Weld", collidepartofleftleg)
  329. weeld.Part0 = game.Players.LocalPlayer.Character["Right Leg"]
  330. weeld.Part1 = collidepartofleftleg
  331. weeld.C0 = weeld.C0 * CFrame.new(0,-0.3,0)
  332. end
  333. if game.Players.LocalPlayer.Character:findFirstChild("Left Leg") then
  334. local attachment = Instance.new("Attachment", game.Players.LocalPlayer.Character.Torso)
  335. attachment.Position = Vector3.new(-0.5, -1, 0)
  336. local ball = Instance.new("BallSocketConstraint", game.Players.LocalPlayer.Character)
  337. ball.Attachment0 = game.Players.LocalPlayer.Character["Left Leg"].LeftFootAttachment
  338. ball.Attachment1 = attachment
  339. game.Players.LocalPlayer.Character["Left Leg"].LeftFootAttachment.Position = Vector3.new(0, 1, 0)
  340. local collidepartofleftleg = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  341. collidepartofleftleg.Name = "Bone"
  342. collidepartofleftleg.Size = Vector3.new(0.8,1.4,0.8)
  343. collidepartofleftleg.Transparency = 1
  344. collidepartofleftleg:BreakJoints()
  345. local weeld = Instance.new("Weld", collidepartofleftleg)
  346. weeld.Part0 = game.Players.LocalPlayer.Character["Left Leg"]
  347. weeld.Part1 = collidepartofleftleg
  348. weeld.C0 = weeld.C0 * CFrame.new(0,-0.3,0)
  349. end
  350. if game.Players.LocalPlayer.Character:findFirstChild("Head") then
  351. local attachment = Instance.new("Attachment", game.Players.LocalPlayer.Character.Head)
  352. attachment.Position = Vector3.new(0, -0.5, 0)
  353. attachment.Name = "lol"
  354. attachment.Visible = false
  355. game.Players.LocalPlayer.Character.Torso.NeckAttachment.Visible = false
  356. game.Players.LocalPlayer.Character.Torso.NeckAttachment.Position = game.Players.LocalPlayer.Character.Torso.NeckAttachment.Position + Vector3.new(0,0,0)
  357. local ball = Instance.new("BallSocketConstraint", game.Players.LocalPlayer.Character)
  358. ball.Attachment0 = game.Players.LocalPlayer.Character.Torso.NeckAttachment
  359. ball.Attachment1 = attachment
  360. ball.LimitsEnabled = true
  361. ball.TwistLimitsEnabled = true
  362. ball.UpperAngle = 90
  363. ball.Restitution = 0.5
  364. ball.TwistUpperAngle = 180
  365. ball.TwistLowerAngle = -180
  366. local collidepartofleftleg = Instance.new("Part", game.Players.LocalPlayer.Character.Torso)
  367. collidepartofleftleg.Name = "Bone"
  368. collidepartofleftleg.Size = Vector3.new(0.7,0.7,0.7)
  369. collidepartofleftleg.Transparency = 1
  370. collidepartofleftleg:BreakJoints()
  371. local weeld = Instance.new("Weld", collidepartofleftleg)
  372. weeld.Part0 = collidepartofleftleg
  373. weeld.Part1 = game.Players.LocalPlayer.Character["Head"]
  374. if game.Players.LocalPlayer.Character.Torso:findFirstChild("Neck") then
  375. game.Players.LocalPlayer.Character.Torso.Neck:destroy()
  376. end
  377. if game.Players.LocalPlayer.Character.Head:findFirstChild("face") then
  378. game.Players.LocalPlayer.Character.Head.face.Texture = "http://www.roblox.com/asset/?id=810245460"
  379. end
  380. end
  381. game.Players.LocalPlayer.Character.Humanoid:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
  382. game.Players.LocalPlayer.Character.Humanoid.Health = 0.1
  383. game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 0
  384. game.Players.LocalPlayer.Character.Humanoid.JumpPower = 0
  385. local dead = Instance.new("Sound", game.Players.LocalPlayer.Character.Head)
  386. dead.Volume = 10
  387. dead.SoundId = "rbxassetid://1248405065"
  388. dead:Play()
  389. dead.Looped = true
  390. while true do
  391. game.Players.LocalPlayer.Character.Humanoid.Health = 0.1
  392. game.Players.LocalPlayer.Character.Humanoid.PlatformStand = true
  393. wait()
  394. end
  395. end
  396. TextButton.MouseButton1Click:connect(kys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement