sIendytubble

terraform people into a standard part

Apr 13th, 2021 (edited)
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.36 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,game,owner = owner,game
  3. local RealPlayer = Player
  4. do
  5. print("FE Compatibility code by Mokiros")
  6. local rp = RealPlayer
  7. script.Parent = rp.Character
  8.  
  9. --RemoteEvent for communicating
  10. local Event = Instance.new("RemoteEvent")
  11. Event.Name = "UserInput_Event"
  12.  
  13. --Fake event to make stuff like Mouse.KeyDown work
  14. local function fakeEvent()
  15. local t = {_fakeEvent=true,Functions={},Connect=function(self,f)table.insert(self.Functions,f) end}
  16. t.connect = t.Connect
  17. return t
  18. end
  19.  
  20. --Creating fake input objects with fake variables
  21. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent(),Button2Up=fakeEvent(),Button2Down=fakeEvent()}
  22. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  23. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  24. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  25. end}
  26. --Merged 2 functions into one by checking amount of arguments
  27. CAS.UnbindAction = CAS.BindAction
  28.  
  29. --This function will trigger the events that have been :Connect()'ed
  30. local function te(self,ev,...)
  31. local t = m[ev]
  32. if t and t._fakeEvent then
  33. for _,f in pairs(t.Functions) do
  34. f(...)
  35. end
  36. end
  37. end
  38. m.TrigEvent = te
  39. UIS.TrigEvent = te
  40.  
  41. Event.OnServerEvent:Connect(function(plr,io)
  42. if plr~=rp then return end
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. if not io.isMouse then
  46. local b = io.UserInputState == Enum.UserInputState.Begin
  47. if io.UserInputType == Enum.UserInputType.MouseButton1 then
  48. return m:TrigEvent(b and "Button1Down" or "Button1Up")
  49. end
  50. if io.UserInputType == Enum.UserInputType.MouseButton2 then
  51. return m:TrigEvent(b and "Button2Down" or "Button2Up")
  52. end
  53. for _,t in pairs(CAS.Actions) do
  54. for _,k in pairs(t.Keys) do
  55. if k==io.KeyCode then
  56. t.Function(t.Name,io.UserInputState,io)
  57. end
  58. end
  59. end
  60. m:TrigEvent(b and "KeyDown" or "KeyUp",io.KeyCode.Name:lower())
  61. UIS:TrigEvent(b and "InputBegan" or "InputEnded",io,false)
  62. end
  63. end)
  64. Event.Parent = NLS([==[
  65. local Player = game:GetService("Players").LocalPlayer
  66. local Event = script:WaitForChild("UserInput_Event")
  67. local Mouse = Player:GetMouse()
  68. local UIS = game:GetService("UserInputService")
  69. local input = function(io,a)
  70. if a then return end
  71. --Since InputObject is a client-side instance, we create and pass table instead
  72. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState,Hit=Mouse.Hit,Target=Mouse.Target})
  73. end
  74. UIS.InputBegan:Connect(input)
  75. UIS.InputEnded:Connect(input)
  76. local h,t
  77. --Give the server mouse data 30 times every second, but only if the values changed
  78. --If player is not moving their mouse, client won't fire events
  79. while wait(1/30) do
  80. if h~=Mouse.Hit or t~=Mouse.Target then
  81. h,t=Mouse.Hit,Mouse.Target
  82. Event:FireServer({isMouse=true,Target=t,Hit=h})
  83. end
  84. end]==],Player.Character)
  85.  
  86. ----Sandboxed game object that allows the usage of client-side methods and services
  87. --Real game object
  88. local _rg = game
  89.  
  90. --Metatable for fake service
  91. local fsmt = {
  92. __index = function(self,k)
  93. local s = rawget(self,"_RealService")
  94. if s then
  95. return typeof(s[k])=="function"
  96. and function(_,...)return s[k](s,...)end or s[k]
  97. end
  98. end,
  99. __newindex = function(self,k,v)
  100. local s = rawget(self,"_RealService")
  101. if s then s[k]=v end
  102. end
  103. }
  104. local function FakeService(t,RealService)
  105. t._RealService = typeof(RealService)=="string" and _rg:GetService(RealService) or RealService
  106. return setmetatable(t,fsmt)
  107. end
  108.  
  109. --Fake game object
  110. local g = {
  111. GetService = function(self,s)
  112. return rawget(self,s) or _rg:GetService(s)
  113. end,
  114. Players = FakeService({
  115. LocalPlayer = FakeService({GetMouse=function(self)return m end},Player)
  116. },"Players"),
  117. UserInputService = FakeService(UIS,"UserInputService"),
  118. ContextActionService = FakeService(CAS,"ContextActionService"),
  119. RunService = FakeService({
  120. _btrs = {},
  121. RenderStepped = _rg:GetService("RunService").Heartbeat,
  122. BindToRenderStep = function(self,name,_,fun)
  123. self._btrs[name] = self.Heartbeat:Connect(fun)
  124. end,
  125. UnbindFromRenderStep = function(self,name)
  126. self._btrs[name]:Disconnect()
  127. end,
  128. },"RunService")
  129. }
  130. rawset(g.Players,"localPlayer",g.Players.LocalPlayer)
  131. g.service = g.GetService
  132. FakeService(g,game)
  133. --Changing owner to fake player object to support owner:GetMouse()
  134. game,owner = g,g.Players.LocalPlayer
  135. end
  136. function terraform(victim)
  137. function lerp(a,start,part1,part2,dag)
  138. coroutine.resume(coroutine.create(function()
  139. while wait() do
  140. part1.CFrame = part1.CFrame:Lerp(part2.CFrame,0.27)
  141. a.Size = Vector3.new(part1.CFrame.X,part1.CFrame.Y,part1.CFrame.Z)
  142. a.CFrame = a.CFrame:Lerp(dag.CFrame,0.27)
  143. end
  144. end))
  145. end
  146. mas = workspace
  147. Model0 = Instance.new("Model")
  148. Part1 = Instance.new("Part")
  149. Part2 = Instance.new("Part")
  150. Weld3 = Instance.new("Weld")
  151. CFrameValue4 = Instance.new("CFrameValue")
  152. Part5 = Instance.new("Part")
  153. Weld6 = Instance.new("Weld")
  154. CFrameValue7 = Instance.new("CFrameValue")
  155. Part8 = Instance.new("Part")
  156. Weld9 = Instance.new("Weld")
  157. CFrameValue10 = Instance.new("CFrameValue")
  158. Part11 = Instance.new("Part")
  159. Weld12 = Instance.new("Weld")
  160. CFrameValue13 = Instance.new("CFrameValue")
  161. Part14 = Instance.new("Part")
  162. Weld15 = Instance.new("Weld")
  163. CFrameValue16 = Instance.new("CFrameValue")
  164. Part17 = Instance.new("Part")
  165. Weld18 = Instance.new("Weld")
  166. CFrameValue19 = Instance.new("CFrameValue")
  167. Model0.Name = "parta"
  168. Model0.Parent = mas
  169. Part1.Name = "Head"
  170. Part1.Parent = Model0
  171. Part1.CFrame = CFrame.new(31.5, 1.80003285, 27.0000076, 1, -3.84727355e-06, -5.72111094e-06, 3.84736677e-06, 1, 1.62615397e-05, 5.72104818e-06, -1.62615615e-05, 1)
  172. Part1.Position = Vector3.new(31.5, 1.80003285, 27.0000076)
  173. Part1.Transparency = 1
  174. Part1.Size = Vector3.new(1, 1.20000005, 2)
  175. Part1.CanCollide = false
  176. Part2.Name = "Torso"
  177. Part2.Parent = Model0
  178. Part2.CFrame = CFrame.new(30.5, 1.80002904, 27.0000019, 1, -3.84727355e-06, -5.72111094e-06, 3.84736677e-06, 1, 1.62615397e-05, 5.72104818e-06, -1.62615615e-05, 1)
  179. Part2.Position = Vector3.new(30.5, 1.80002904, 27.0000019)
  180. Part2.Transparency = 1
  181. Part2.Size = Vector3.new(1, 1.20000005, 2)
  182. Part2.CanCollide = false
  183. Weld3.Name = "qCFrameWeldThingy"
  184. Weld3.Parent = Part2
  185. Weld3.C1 = CFrame.new(1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  186. Weld3.Part0 = Part1
  187. Weld3.Part1 = Part2
  188. Weld3.part1 = Part2
  189. CFrameValue4.Name = "qRelativeCFrameWeldValue"
  190. CFrameValue4.Parent = Part2
  191. CFrameValue4.Value = CFrame.new(1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  192. Part5.Name = "Right Arm"
  193. Part5.Parent = Model0
  194. Part5.CFrame = CFrame.new(29.4999962, 1.80003333, 27.4999962, 1, -3.84727355e-06, -5.72111094e-06, 3.84736677e-06, 1, 1.62615397e-05, 5.72104818e-06, -1.62615615e-05, 1)
  195. Part5.Position = Vector3.new(29.4999962, 1.80003333, 27.4999962)
  196. Part5.Transparency = 1
  197. Part5.Size = Vector3.new(1, 1.20000005, 1)
  198. Part5.CanCollide = false
  199. Weld6.Name = "qCFrameWeldThingy"
  200. Weld6.Parent = Part5
  201. Weld6.C1 = CFrame.new(2, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  202. Weld6.Part0 = Part1
  203. Weld6.Part1 = Part5
  204. Weld6.part1 = Part5
  205. CFrameValue7.Name = "qRelativeCFrameWeldValue"
  206. CFrameValue7.Parent = Part5
  207. CFrameValue7.Value = CFrame.new(2, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  208. Part8.Name = "Left Arm"
  209. Part8.Parent = Model0
  210. Part8.CFrame = CFrame.new(29.5000038, 1.800017, 26.4999962, 1, -3.84727355e-06, -5.72111094e-06, 3.84736677e-06, 1, 1.62615397e-05, 5.72104818e-06, -1.62615615e-05, 1)
  211. Part8.Position = Vector3.new(29.5000038, 1.800017, 26.4999962)
  212. Part8.Transparency = 1
  213. Part8.Size = Vector3.new(1, 1.20000005, 1)
  214. Part8.CanCollide = false
  215. Weld9.Name = "qCFrameWeldThingy"
  216. Weld9.Parent = Part8
  217. Weld9.C1 = CFrame.new(2, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  218. Weld9.Part0 = Part1
  219. Weld9.Part1 = Part8
  220. Weld9.part1 = Part8
  221. CFrameValue10.Name = "qRelativeCFrameWeldValue"
  222. CFrameValue10.Parent = Part8
  223. CFrameValue10.Value = CFrame.new(2, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  224. Part11.Name = "Right Leg"
  225. Part11.Parent = Model0
  226. Part11.CFrame = CFrame.new(28.4999962, 1.8000294, 27.4999905, 1, -3.84727355e-06, -5.72111094e-06, 3.84736677e-06, 1, 1.62615397e-05, 5.72104818e-06, -1.62615615e-05, 1)
  227. Part11.Position = Vector3.new(28.4999962, 1.8000294, 27.4999905)
  228. Part11.Transparency = 1
  229. Part11.Size = Vector3.new(1, 1.20000005, 1)
  230. Part11.CanCollide = false
  231. Weld12.Name = "qCFrameWeldThingy"
  232. Weld12.Parent = Part11
  233. Weld12.C1 = CFrame.new(3, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  234. Weld12.Part0 = Part1
  235. Weld12.Part1 = Part11
  236. Weld12.part1 = Part11
  237. CFrameValue13.Name = "qRelativeCFrameWeldValue"
  238. CFrameValue13.Parent = Part11
  239. CFrameValue13.Value = CFrame.new(3, 0, -0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  240. Part14.Name = "Left Leg"
  241. Part14.Parent = Model0
  242. Part14.CFrame = CFrame.new(28.5000038, 1.80001318, 26.4999905, 1, -3.84727355e-06, -5.72111094e-06, 3.84736677e-06, 1, 1.62615397e-05, 5.72104818e-06, -1.62615615e-05, 1)
  243. Part14.Position = Vector3.new(28.5000038, 1.80001318, 26.4999905)
  244. Part14.Transparency = 1
  245. Part14.Size = Vector3.new(1, 1.20000005, 1)
  246. Part14.CanCollide = false
  247. Weld15.Name = "qCFrameWeldThingy"
  248. Weld15.Parent = Part14
  249. Weld15.C1 = CFrame.new(3, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  250. Weld15.Part0 = Part1
  251. Weld15.Part1 = Part14
  252. Weld15.part1 = Part14
  253. CFrameValue16.Name = "qRelativeCFrameWeldValue"
  254. CFrameValue16.Parent = Part14
  255. CFrameValue16.Value = CFrame.new(3, 0, 0.5, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  256. Part17.Name = "goibonfdnd"
  257. Part17.Parent = Model0
  258. Part17.CFrame = CFrame.new(30, 1.80002713, 27, 1, -3.84727355e-06, -5.72111094e-06, 3.84736677e-06, 1, 1.62615397e-05, 5.72104818e-06, -1.62615615e-05, 1)
  259. Part17.Position = Vector3.new(30, 1.80002713, 27)
  260. Part17.Transparency = 1
  261. Part17.Size = Vector3.new(2, 1.20000005, 2)
  262. Part17.Anchored = true
  263. Part17.CanCollide = false
  264. Weld18.Name = "qCFrameWeldThingy"
  265. Weld18.Parent = Part17
  266. Weld18.C1 = CFrame.new(1.5, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  267. Weld18.Part0 = Part1
  268. Weld18.Part1 = Part17
  269. Weld18.part1 = Part17
  270. CFrameValue19.Name = "qRelativeCFrameWeldValue"
  271. CFrameValue19.Parent = Part17
  272. CFrameValue19.Value = CFrame.new(1.5, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  273. char = victim
  274. barta = Model0
  275. for i,v in pairs(victim:GetDescendants()) do
  276. if v.ClassName == "Sound" then
  277. v:Destroy()
  278. end
  279. end
  280. Sound0 = Instance.new("Sound")
  281. Sound0.Name = "Oof Sound"
  282. Sound0.Parent = char.Head
  283. Sound0.SoundId = "rbxassetid://5159450402"
  284. Sound0.Volume = 1
  285. Sound0:Play()
  286. coroutine.resume(coroutine.create(function()
  287. for i = 0, 27 do
  288. Sound0.PlaybackSpeed = Sound0.PlaybackSpeed - 0.1
  289. wait(0.1)
  290. end
  291. end))
  292. Part17.CFrame = char.Head.CFrame * CFrame.new(0,-3.9,0)
  293. for i,v in pairs(char:GetChildren()) do
  294. if v.ClassName == "Part" then
  295. for i,b in pairs(barta:GetChildren()) do
  296. if b.Name == v.Name then
  297. local para = Instance.new("Part")
  298. para.Position = Vector3.new(v.Size.X,v.Size.Y,v.Size.Z)
  299. para.Size = Vector3.new(para.CFrame.X,para.CFrame.Y,para.CFrame.Z)
  300. local para2 = Instance.new("Part")
  301. para2.Position = Vector3.new(b.Size.X,b.Size.Y,b.Size.Z)
  302. para2.Size = Vector3.new(para2.CFrame.X,para2.CFrame.Y,para2.CFrame.Z)
  303. local A = para.CFrame
  304. X = b.Size.X
  305. Y =b.Size.Y
  306. Z = b.Size.Z
  307. for i,v in pairs(v:GetChildren()) do
  308. if v.Name ~= "Oof Sound" then
  309. v:Destroy()
  310. end
  311. end
  312. --Instance.new("BlockMesh",v)
  313. v.Parent = workspace
  314. v.Anchored = true
  315. v.Name = "Part"
  316. v.BottomSurface = "Inlet"--Enum.SurfaceType.Inlet
  317. v.TopSurface = "Studs"
  318. v.CanCollide = false
  319. v:BreakJoints()
  320. lerp(v,A,para,para2,b)
  321. local tweenInfo = TweenInfo.new(
  322. 0.27,
  323. Enum.EasingStyle.Linear,
  324. Enum.EasingDirection.In,
  325. 0,
  326. false
  327. )
  328.  
  329. -- anim.KeyframeReached:Connect(function(keyframeName)
  330. -- if keyframeName == "Zombify" then
  331. tweenService = game:GetService("TweenService")
  332. local tween = tweenService:Create(v, tweenInfo, { Color = Color3.fromRGB(163, 162, 165) })
  333. tween:Play()
  334. end
  335. end
  336. end
  337. end
  338. end
  339. mouse = game.Players.LocalPlayer:GetMouse()
  340. mouse.Button1Down:Connect(function()
  341. --torso.Velocity = torso.Velocity + Vector3.new(0,40,0) *10
  342. if mouse.Target.Parent ~= nil and mouse.Target.Parent:FindFirstChildOfClass("Humanoid") ~= nil then
  343. terraform(mouse.Target.Parent)
  344. end
  345. end)
Add Comment
Please, Sign In to add comment