Advertisement
waconline

monster thingie

Feb 15th, 2020
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.39 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. function sandbox(var,func)
  153. local env = getfenv(func)
  154. local newenv = setmetatable({},{
  155. __index = function(self,k)
  156. if k=="script" then
  157. return var
  158. else
  159. return env[k]
  160. end
  161. end,
  162. })
  163. setfenv(func,newenv)
  164. return func
  165. end
  166. cors = {}
  167. mas = Instance.new("Model",game:GetService("Lighting"))
  168. Model0 = Instance.new("Model")
  169. Part1 = Instance.new("Part")
  170. Motor6D2 = Instance.new("Motor6D")
  171. Part3 = Instance.new("Part")
  172. Motor6D4 = Instance.new("Motor6D")
  173. Motor6D5 = Instance.new("Motor6D")
  174. Motor6D6 = Instance.new("Motor6D")
  175. Motor6D7 = Instance.new("Motor6D")
  176. Part8 = Instance.new("Part")
  177. Part9 = Instance.new("Part")
  178. Part10 = Instance.new("Part")
  179. Part11 = Instance.new("Part")
  180. Part12 = Instance.new("Part")
  181. SpecialMesh13 = Instance.new("SpecialMesh")
  182. Part14 = Instance.new("Part")
  183. Part15 = Instance.new("Part")
  184. Humanoid16 = Instance.new("Humanoid")
  185. Model0.Name = ""
  186. Model0.Parent = mas
  187. Model0.PrimaryPart = Part1
  188. Part1.Name = "HumanoidRootPart"
  189. Part1.Parent = Model0
  190. Part1.CFrame = CFrame.new(68.1717529, -93.5077972, -119.408203, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  191. Part1.Position = Vector3.new(68.1717529, -93.5077972, -119.408203)
  192. Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  193. Part1.Transparency = 0.5
  194. Part1.Size = Vector3.new(2, 2, 1)
  195. Part1.Anchored = true
  196. Part1.BottomSurface = Enum.SurfaceType.Smooth
  197. Part1.BrickColor = BrickColor.new("Really black")
  198. Part1.TopSurface = Enum.SurfaceType.Smooth
  199. Part1.brickColor = BrickColor.new("Really black")
  200. Motor6D2.Name = "Root Hip"
  201. Motor6D2.Parent = Part1
  202. Motor6D2.MaxVelocity = 0.10000000149012
  203. Motor6D2.C0 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  204. Motor6D2.C1 = CFrame.new(0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 1, -0)
  205. Motor6D2.Part0 = Part1
  206. Motor6D2.Part1 = Part3
  207. Motor6D2.part1 = Part3
  208. Part3.Name = "Torso"
  209. Part3.Parent = Model0
  210. Part3.CFrame = CFrame.new(68.1717529, -93.5077972, -119.408203, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  211. Part3.Position = Vector3.new(68.1717529, -93.5077972, -119.408203)
  212. Part3.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  213. Part3.Size = Vector3.new(2, 2, 1)
  214. Part3.Anchored = true
  215. Part3.BottomSurface = Enum.SurfaceType.Smooth
  216. Part3.BrickColor = BrickColor.new("Really black")
  217. Part3.CanCollide = false
  218. Part3.TopSurface = Enum.SurfaceType.Smooth
  219. Part3.brickColor = BrickColor.new("Really black")
  220. Motor6D4.Name = "Left Hip"
  221. Motor6D4.Parent = Part3
  222. Motor6D4.MaxVelocity = 0.10000000149012
  223. Motor6D4.C0 = CFrame.new(-1, -1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  224. Motor6D4.C1 = CFrame.new(-0.5, 1, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  225. Motor6D4.Part0 = Part3
  226. Motor6D4.Part1 = Part8
  227. Motor6D4.part1 = Part8
  228. Motor6D5.Name = "Right Hip"
  229. Motor6D5.Parent = Part3
  230. Motor6D5.MaxVelocity = 0.10000000149012
  231. Motor6D5.C0 = CFrame.new(1, -1, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  232. Motor6D5.C1 = CFrame.new(0.5, 1, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  233. Motor6D5.Part0 = Part3
  234. Motor6D5.Part1 = Part9
  235. Motor6D5.part1 = Part9
  236. Motor6D6.Name = "Left Shoulder"
  237. Motor6D6.Parent = Part3
  238. Motor6D6.MaxVelocity = 0.10000000149012
  239. Motor6D6.C0 = CFrame.new(-1, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  240. Motor6D6.C1 = CFrame.new(0.5, 0.5, 0, -4.37113883e-08, 0, -1, 0, 0.99999994, 0, 1, 0, -4.37113883e-08)
  241. Motor6D6.Part0 = Part3
  242. Motor6D6.Part1 = Part10
  243. Motor6D6.part1 = Part10
  244. Motor6D7.Name = "Right Shoulder"
  245. Motor6D7.Parent = Part3
  246. Motor6D7.MaxVelocity = 0.10000000149012
  247. Motor6D7.C0 = CFrame.new(1, 0.5, 0, -4.37113883e-08, 0, 1, -0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  248. Motor6D7.C1 = CFrame.new(-0.5, 0.5, 0, -4.37113883e-08, 0, 1, 0, 0.99999994, 0, -1, 0, -4.37113883e-08)
  249. Motor6D7.Part0 = Part3
  250. Motor6D7.Part1 = Part11
  251. Motor6D7.part1 = Part11
  252. Part8.Name = "Left Leg"
  253. Part8.Parent = Model0
  254. Part8.CFrame = CFrame.new(67.6717529, -95.5077972, -119.408203, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
  255. Part8.Position = Vector3.new(67.6717529, -95.5077972, -119.408203)
  256. Part8.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  257. Part8.Size = Vector3.new(1, 2, 1)
  258. Part8.Anchored = true
  259. Part8.BottomSurface = Enum.SurfaceType.Smooth
  260. Part8.BrickColor = BrickColor.new("Really black")
  261. Part8.CanCollide = false
  262. Part8.TopSurface = Enum.SurfaceType.Smooth
  263. Part8.brickColor = BrickColor.new("Really black")
  264. Part9.Name = "Right Leg"
  265. Part9.Parent = Model0
  266. Part9.CFrame = CFrame.new(68.6717529, -95.5077972, -119.408203, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
  267. Part9.Position = Vector3.new(68.6717529, -95.5077972, -119.408203)
  268. Part9.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  269. Part9.Size = Vector3.new(1, 2, 1)
  270. Part9.Anchored = true
  271. Part9.BottomSurface = Enum.SurfaceType.Smooth
  272. Part9.BrickColor = BrickColor.new("Really black")
  273. Part9.CanCollide = false
  274. Part9.TopSurface = Enum.SurfaceType.Smooth
  275. Part9.brickColor = BrickColor.new("Really black")
  276. Part10.Name = "Left Arm"
  277. Part10.Parent = Model0
  278. Part10.CFrame = CFrame.new(66.6717529, -93.5077972, -119.408203, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
  279. Part10.Position = Vector3.new(66.6717529, -93.5077972, -119.408203)
  280. Part10.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  281. Part10.Size = Vector3.new(1, 2, 1)
  282. Part10.Anchored = true
  283. Part10.BottomSurface = Enum.SurfaceType.Smooth
  284. Part10.BrickColor = BrickColor.new("Really black")
  285. Part10.CanCollide = false
  286. Part10.TopSurface = Enum.SurfaceType.Smooth
  287. Part10.brickColor = BrickColor.new("Really black")
  288. Part11.Name = "Right Arm"
  289. Part11.Parent = Model0
  290. Part11.CFrame = CFrame.new(69.6717529, -93.5077972, -119.408203, 1, 0, 0, 0, 0.999999881, 0, 0, 0, 1)
  291. Part11.Position = Vector3.new(69.6717529, -93.5077972, -119.408203)
  292. Part11.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  293. Part11.Size = Vector3.new(1, 2, 1)
  294. Part11.Anchored = true
  295. Part11.BottomSurface = Enum.SurfaceType.Smooth
  296. Part11.BrickColor = BrickColor.new("Really black")
  297. Part11.CanCollide = false
  298. Part11.TopSurface = Enum.SurfaceType.Smooth
  299. Part11.brickColor = BrickColor.new("Really black")
  300. Part12.Name = "Head"
  301. Part12.Parent = Model0
  302. Part12.CFrame = CFrame.new(68.1717529, -91.9877472, -119.408203, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  303. Part12.Position = Vector3.new(68.1717529, -91.9877472, -119.408203)
  304. Part12.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  305. Part12.Size = Vector3.new(1.28000093, 1.29999971, 1.5999999)
  306. Part12.Anchored = true
  307. Part12.BottomSurface = Enum.SurfaceType.Smooth
  308. Part12.BrickColor = BrickColor.new("Really black")
  309. Part12.TopSurface = Enum.SurfaceType.Smooth
  310. Part12.brickColor = BrickColor.new("Really black")
  311. SpecialMesh13.Parent = Part12
  312. Part14.Name = "Red Eyes"
  313. Part14.Parent = Part12
  314. Part14.CFrame = CFrame.new(68.4727325, -91.8777466, -119.943275, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  315. Part14.Orientation = Vector3.new(0, 90, 0)
  316. Part14.Position = Vector3.new(68.4727325, -91.8777466, -119.943275)
  317. Part14.Rotation = Vector3.new(0, 90, 0)
  318. Part14.Color = Color3.new(1, 0, 0)
  319. Part14.Size = Vector3.new(0.290000021, 1, 0.340000033)
  320. Part14.Anchored = true
  321. Part14.BottomSurface = Enum.SurfaceType.Smooth
  322. Part14.BrickColor = BrickColor.new("Really red")
  323. Part14.Material = Enum.Material.Neon
  324. Part14.TopSurface = Enum.SurfaceType.Smooth
  325. Part14.brickColor = BrickColor.new("Really red")
  326. Part14.Shape = Enum.PartType.Cylinder
  327. Part15.Name = "Red Eyes"
  328. Part15.Parent = Part12
  329. Part15.CFrame = CFrame.new(67.8907318, -91.8777466, -119.943275, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  330. Part15.Orientation = Vector3.new(0, 90, 0)
  331. Part15.Position = Vector3.new(67.8907318, -91.8777466, -119.943275)
  332. Part15.Rotation = Vector3.new(0, 90, 0)
  333. Part15.Color = Color3.new(1, 0, 0)
  334. Part15.Size = Vector3.new(0.290000021, 1, 0.340000033)
  335. Part15.Anchored = true
  336. Part15.BottomSurface = Enum.SurfaceType.Smooth
  337. Part15.BrickColor = BrickColor.new("Really red")
  338. Part15.Material = Enum.Material.Neon
  339. Part15.TopSurface = Enum.SurfaceType.Smooth
  340. Part15.brickColor = BrickColor.new("Really red")
  341. Part15.Shape = Enum.PartType.Cylinder
  342. Humanoid16.Parent = Model0
  343. Humanoid16.LeftLeg = Part8
  344. Humanoid16.RightLeg = Part9
  345. Humanoid16.Torso = Part1
  346. for i,v in pairs(mas:GetChildren()) do
  347. v.Parent = workspace
  348. pcall(function() v:MakeJoints() end)
  349. end
  350. mas:Destroy()
  351. for i,v in pairs(cors) do
  352. spawn(function()
  353. pcall(v)
  354. end)
  355. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement