Advertisement
lafur

Untitled

Feb 8th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 print("FE Compatibility code V2 by Mokiros")local RealPlayer=RealPlayer;script.Parent=RealPlayer.Character;local a=function(b)b[1].f[b[2]]=nil end;local c={__index={disconnect=a,Disconnect=a}}local d={__index={Connect=function(b,e)local f=tostring(math.random(0,10000))while b.f[f]do f=tostring(math.random(0,10000))end;b.f[f]=e;return setmetatable({b,f},c)end}}d.__index.connect=d.__index.Connect;local function g()return setmetatable({f={}},d)end;local h={Hit=CFrame.new(),KeyUp=g(),KeyDown=g(),Button1Up=g(),Button1Down=g(),Button2Up=g(),Button2Down=g()}h.keyUp=h.KeyUp;h.keyDown=h.KeyDown;local i={InputBegan=g(),InputEnded=g()}local CAS={Actions={},BindAction=function(self,j,k,l,...)CAS.Actions[j]=k and{Name=j,Function=k,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function m(self,n,...)for o,e in pairs(self[n].f)do e(...)end end;h.T=m;i.T=m;local p=Instance.new("RemoteEvent")p.Name="UserInput_Event"p.OnServerEvent:Connect(function(q,r)if q~=RealPlayer then return end;h.Target=r.e;h.Hit=r.d;if not r.f then local s=r.c==Enum.UserInputState.Begin;if r.b==Enum.UserInputType.MouseButton1 then return h:T(s and"Button1Down"or"Button1Up")end;if r.b==Enum.UserInputType.MouseButton2 then return h:T(s and"Button2Down"or"Button2Up")end;for o,t in pairs(CAS.Actions)do for o,u in pairs(t.Keys)do if u==r.a then t.Function(t.Name,r.c,r)end end end;h:T(s and"KeyDown"or"KeyUp",r.a.Name:lower())i:T(s and"InputBegan"or"InputEnded",r,false)end end)p.Parent=NLS([==[local a=script:WaitForChild("UserInput_Event")local b=owner:GetMouse()local c=game:GetService("UserInputService")local d=function(e,f)if f then return end;a:FireServer({a=e.KeyCode,b=e.UserInputType,c=e.UserInputState,d=b.Hit,e=b.Target})end;c.InputBegan:Connect(d)c.InputEnded:Connect(d)local g,h;local i=game:GetService("RunService").Heartbeat;while true do if g~=b.Hit or h~=b.Target then g,h=b.Hit,b.Target;a:FireServer({f=1,Target=h,d=g})end;for j=1,2 do i:Wait()end end]==],script)local v=game;local w={__index=function(self,u)local x=rawget(self,"_RealService")if x then return typeof(x[u])=="function"and function(o,...)return x[u](x,...)end or x[u]end end,__newindex=function(self,u,y)local x=rawget(self,"_RealService")if x then x[u]=y end end}local function z(t,A)t._RealService=typeof(A)=="string"and v:GetService(A)or A;return setmetatable(t,w)end;local B={GetService=function(self,x)return rawget(self,x)or v:GetService(x)end,Players=z({LocalPlayer=z({GetMouse=function(self)return h end},Player)},"Players"),UserInputService=z(i,"UserInputService"),ContextActionService=z(CAS,"ContextActionService"),RunService=z({_btrs={},RenderStepped=v:GetService("RunService").Heartbeat,BindToRenderStep=function(self,j,o,k)self._btrs[j]=self.Heartbeat:Connect(k)end,UnbindFromRenderStep=function(self,j)self._btrs[j]:Disconnect()end},"RunService")}rawset(B.Players,"localPlayer",B.Players.LocalPlayer)B.service=B.GetService;z(B,game)game,owner=B,B.Players.LocalPlayer end plr = game.Players.LocalPlayer
  6. repeat wait() until plr.Character
  7. char = plr.Character
  8.  
  9. effect = Instance.new("Model",char)
  10. effect.Name = "Effects"
  11.  
  12.  
  13. moozik = Instance.new("Sound",char)
  14. moozik.SoundId = "rbxassetid://132024343"
  15. moozik.Volume = 10
  16. moozik.Looped = true
  17. moozik:Play()
  18. hurt = Instance.new("Sound",char)
  19. hurt.SoundId = "rbxassetid://975173739"
  20. hurt.Volume = 10
  21.  
  22.  
  23.  
  24.  
  25. local block = Instance.new("Part",effect)
  26. block.Size = Vector3.new(1,1,1)
  27. block.CanCollide = false
  28. local weld = Instance.new("Weld",block)
  29. weld.Part0 = block
  30. weld.Part1 = char["Right Arm"]
  31. weld.C0 = CFrame.new(-0.00427627563, -0.0187358856, 1.48222256, 1, 0, 0, 0, -0.0125430031, -0.999921381, 0, 0.999921262, -0.0125430049)
  32. local decal1 = Instance.new("Decal",block)
  33. decal1.Face = "Top"
  34. local decal2 = Instance.new("Decal",block)
  35. decal2.Face = "Front"
  36. local decal3 = Instance.new("Decal",block)
  37. decal3.Face = "Bottom"
  38. local decal4 = Instance.new("Decal",block)
  39. decal4.Face = "Back"
  40. local decal5 = Instance.new("Decal",block)
  41. decal5.Face = "Left"
  42. local decal6 = Instance.new("Decal",block)
  43. decal6.Face = "Right"
  44. damaged = false
  45. local reddamage = function(timeofeffect)
  46. for i,v in pairs(char:GetChildren()) do
  47. if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
  48. local cp = v:Clone()
  49. cp.Parent = effect
  50. cp.BrickColor = BrickColor.new("Really red")
  51. cp.Transparency = 0.7
  52. cp.CanCollide = false
  53. cp.Material = Enum.Material.Neon
  54. if cp.Name == "Head" then
  55. cp.face:Destroy()
  56. end
  57. if cp.Name == "Torso" then
  58. cp.roblox:Destroy()
  59. end
  60. if v ~= char.Head then
  61. cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  62. else
  63. cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  64. end
  65. local weld = Instance.new("Weld",cp)
  66. weld.Part0 = v
  67. weld.Part1 = cp
  68. game:GetService("Debris"):AddItem(cp,timeofeffect)
  69. end
  70. end
  71. char.Torso.Velocity = char.Torso.CFrame.lookVector * -100
  72. hurt:Play()
  73. end
  74.  
  75. function changeyourblockdecal(bottom,top,left,right,back,front)
  76. decal3.Texture = bottom
  77. decal1.Texture = top
  78. decal5.Texture = left
  79. decal6.Texture = right
  80. decal4.Texture = back
  81. decal2.Texture = front
  82. end
  83. function changeblockdecal(whatblock , bottom,top,left,right,back,front)
  84. local tex1 = Instance.new("Decal",whatblock)
  85. tex1.Face = "Top"
  86. local tex2 = Instance.new("Decal",whatblock)
  87. tex2.Face = "Front"
  88. local tex3 = Instance.new("Decal",whatblock)
  89. tex3.Face = "Bottom"
  90. local tex4 = Instance.new("Decal",whatblock)
  91. tex4.Face = "Back"
  92. local tex5 = Instance.new("Decal",whatblock)
  93. tex5.Face = "Left"
  94. local tex6 = Instance.new("Decal",whatblock)
  95. tex6.Face = "Right"
  96. tex3.Texture = bottom
  97. tex1.Texture = top
  98. tex5.Texture = left
  99. tex6.Texture = right
  100. tex4.Texture = back
  101. tex2.Texture = front
  102. end
  103. lhand = char.Torso["Left Shoulder"]:Clone()
  104. rhand = char.Torso["Right Shoulder"]:Clone()
  105. local rhandweld = Instance.new("Weld",char)
  106. rhandweld.Part0 = char.Torso
  107. rhandweld.Part1 = char["Right Arm"]
  108. rhandweld.C0 = CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1)
  109. local human2 = Instance.new("Weld",char)
  110. human2.Part0 = char.HumanoidRootPart
  111. human2.Part1 = char.Torso
  112. human2co = CFrame.new(0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  113.  
  114.  
  115. function changeblocktype(whattype)
  116. if whattype == "Grass" then
  117. changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96430265","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337","http://www.roblox.com/asset/?id=96430337")
  118. end
  119. if whattype == "Dirt" then
  120. changeyourblockdecal("http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755","http://www.roblox.com/asset/?id=96167755")
  121. end
  122. if whattype == "Cobblestone" then
  123. changeyourblockdecal("http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377","http://www.roblox.com/asset/?id=57539377")
  124. end
  125. if whattype == "Gold" then
  126. changeyourblockdecal("http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851","http://www.roblox.com/asset/?id=71405851")
  127. end
  128. if whattype == "Stone" then
  129. changeyourblockdecal("http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261","http://www.roblox.com/asset/?id=56882261")
  130. end
  131. if whattype == "DiamondBlock" then
  132. changeyourblockdecal("http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371","http://www.roblox.com/asset/?id=59262371")
  133. end
  134. if whattype == "DiamondOre" then
  135. changeyourblockdecal("http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647","http://www.roblox.com/asset/?id=49919647")
  136. end
  137. if whattype == "WoodenPlank" then
  138. changeyourblockdecal("http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036","http://www.roblox.com/asset/?id=107806036")
  139. end
  140. if whattype == "OakWood" then
  141. changeyourblockdecal("http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55355773","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786","http://www.roblox.com/asset/?id=55319786")
  142. end
  143. if whattype == "GoldOre" then
  144. changeyourblockdecal("http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646","http://www.roblox.com/asset/?id=73374646")
  145. end
  146. if whattype == "Sponge" then
  147. changeyourblockdecal("http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383","http://www.roblox.com/asset/?id=38945383")
  148. end
  149. end
  150.  
  151. changeblocktype("Grass")
  152.  
  153.  
  154.  
  155. function playanim(whatanim,speed)
  156. if whatanim == "Place" then
  157. rhandweld.Parent = char.Torso
  158. for i = 0,1, speed do
  159. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i)
  160. game:GetService("RunService").RenderStepped:wait()
  161. end
  162. for i = 0,1, speed do
  163. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i)
  164. game:GetService("RunService").RenderStepped:wait()
  165. end
  166. end
  167. if whatanim == "Destroy" then
  168. rhandweld.Parent = char.Torso
  169. for i = 0,1, speed do
  170. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0.473864555, -0.788700104, 1, 0, 0, 0, -0.0214149933, -0.999770641, 0, 0.999770641, -0.0214149933),i)
  171. game:GetService("RunService").RenderStepped:wait()
  172. end
  173. for i = 0,1, speed do
  174. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(0.957962036, 0.0477108955, -1.06759644, 0.445479125, 0.728770554, 0.520040333, 0.0191690028, 0.572963655, -0.81935662, -0.895087242, 0.374974847, 0.241273522),i)
  175. game:GetService("RunService").RenderStepped:wait()
  176. end
  177. end
  178. if whatanim == "NormalPose" then
  179. for i = 0,1 , speed do
  180. rhandweld.C0 = rhandweld.C0:lerp(CFrame.new(1.5, 0, 0, 1, -1.6395192e-43, 0, -1.6395192e-43, 1, 0, 0, 0, 1),i)
  181. game:GetService("RunService").RenderStepped:wait()
  182. end
  183. end
  184. end
  185. canuse = true
  186. mouse = plr:GetMouse()
  187. function buildblock()
  188. if canuse then
  189. canuse = false
  190. playanim("Place", 0.07)
  191. local theactualblock = Instance.new("Part")
  192. theactualblock:BreakJoints()
  193. theactualblock.Parent = workspace
  194. theactualblock.Transparency = 0
  195. theactualblock.CFrame = mouse.Hit + Vector3.new(0,1.09,0)
  196. theactualblock.Orientation = Vector3.new(0,0,0)
  197. theactualblock.Size = Vector3.new(3,3,3)
  198. theactualblock.Anchored = true
  199. theactualblock.CanCollide = true
  200. theactualblock.Name = "BlockPlace"
  201. changeblockdecal(theactualblock,decal3.Texture, decal1.Texture, decal5.Texture,decal6.Texture, decal4.Texture, decal2.Texture)
  202. playanim("NormalPose", 0.3)
  203. canuse = true
  204. end
  205. end
  206. function destroyblock()
  207. if mouse.Target.Name == "BlockPlace" and mouse.Target.Name ~= "Base" and mouse.Target.Name ~= "Baseplate" and mouse.Target.Name ~= "Workspace" then
  208. playanim("Destroy", 0.07)
  209. mouse.Target:Destroy()
  210. playanim("NormalPose", 0.3)
  211. end
  212. end
  213. local mouse1 = mouse.Button1Down:connect(function()
  214. buildblock()
  215. end)
  216. local mouse2 = mouse.KeyDown:connect(function(k)
  217. if k == "q" then
  218. destroyblock()
  219. end
  220. if k == "e" then
  221. local chance = math.random(1,11)
  222. if chance == 1 then
  223. changeblocktype("Grass")
  224. end
  225. if chance == 2 then
  226. changeblocktype("Dirt")
  227. end
  228. if chance == 3 then
  229. changeblocktype("Cobblestone")
  230. end
  231. if chance == 4 then
  232. changeblocktype("Gold")
  233. end
  234. if chance == 5 then
  235. changeblocktype("Stone")
  236. end
  237. if chance == 6 then
  238. changeblocktype("DiamondBlock")
  239. end
  240. if chance == 7 then
  241. changeblocktype("DiamondOre")
  242. end
  243. if chance == 8 then
  244. changeblocktype("WoodenPlank")
  245. end
  246. if chance == 9 then
  247. changeblocktype("OakWood")
  248. end
  249. if chance == 10 then
  250. changeblocktype("GoldOre")
  251. end
  252. if chance == 11 then
  253. changeblocktype("Sponge")
  254. end
  255. end
  256. end)
  257. HasDied = false
  258. Dead = false
  259. local reddeath = function()
  260. for i,v in pairs(char:GetChildren()) do
  261. if v.ClassName == "Part" and v.Name ~= "HumanoidRootPart" then
  262. local cp = v:Clone()
  263. cp.Parent = effect
  264. cp.BrickColor = BrickColor.new("Really red")
  265. cp.Transparency = 1
  266. cp.CanCollide = false
  267. cp.Material = Enum.Material.Neon
  268. if cp.Name == "Head" then
  269. cp.face:Destroy()
  270. end
  271. if cp.Name == "Torso" then
  272. cp.roblox:Destroy()
  273. end
  274. if v ~= char.Head then
  275. cp.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  276. else
  277. cp.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  278. end
  279. local weld = Instance.new("Weld",cp)
  280. weld.Part0 = v
  281. weld.Part1 = cp
  282. end
  283. end
  284. end
  285. reddeath()
  286. generategui = function()
  287. local screen = Instance.new("ScreenGui",plr.PlayerGui)
  288. screen.Name = "Death(lol i was lazy to add buttons lol)"
  289. local text = Instance.new("TextLabel",screen)
  290. text.Text = "You died!"
  291. text.TextColor3 = Color3.new(1,1,1)
  292. text.Font = "Arcade"
  293. text.TextScaled = true
  294. text.Position = UDim2.new(0.381, 0,0.172, 0)
  295. text.Size = UDim2.new(0, 200, 0, 50)
  296. text.BackgroundTransparency = 1
  297. local respawn = Instance.new("TextButton",screen)
  298. respawn.Text = "Respawn"
  299. respawn.TextScaled = true
  300. respawn.Position = UDim2.new(0.381, 0,0.561, 0)
  301. respawn.Size = UDim2.new(0, 200,0, 50)
  302. respawn.BackgroundTransparency = 1
  303. respawn.TextColor3 = Color3.new(1,1,1)
  304. respawn.Font = "Arcade"
  305. respawn.MouseButton1Click:connect(function()
  306. Dead = false
  307. HasDied = false
  308. char.Humanoid.Health = 0
  309. char.Parent = nil
  310. respawn.Text = "Say g/r or g/sr to respawn properly"
  311. end)
  312. end
  313. local BODY = {}
  314. LeftArm = char["Left Arm"]
  315. RightLeg = char["Right Leg"]
  316. LeftLeg = char["Left Leg"]
  317. for _, c in pairs(char:GetDescendants()) do
  318. if c:IsA("BasePart") and c.Name ~= "Handle" then
  319. if c ~= char.HumanoidRootPart and c ~= char.Torso and c ~= char.Head and c ~= char["Right Arm"] and c ~= LeftArm and c ~= RightLeg and c ~= LeftLeg then
  320. c.CustomPhysicalProperties = PhysicalProperties.new(0, 0, 0, 0, 0)
  321. end
  322. table.insert(BODY,{c,c.Parent,c.Material,c.Color,c.Transparency})
  323. elseif c:IsA("JointInstance") then
  324. table.insert(BODY,{c,c.Parent,nil,nil,nil})
  325. end
  326. end
  327. for e = 1, #BODY do
  328. if BODY[e] ~= nil then
  329. local STUFF = BODY[e]
  330. local PART = STUFF[1]
  331. local PARENT = STUFF[2]
  332. local MATERIAL = STUFF[3]
  333. local TRANSPARENCY = STUFF[5]
  334. if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
  335. PART.Material = MATERIAL
  336. PART.Transparency = TRANSPARENCY
  337. end
  338. PART.AncestryChanged:Connect(function()
  339. PART.Parent = PARENT
  340. end)
  341. end
  342. end
  343. function refit()
  344. char.Parent = workspace
  345. for e = 1, #BODY do
  346. if BODY[e] ~= nil then
  347. local STUFF = BODY[e]
  348. local PART = STUFF[1]
  349. local PARENT = STUFF[2]
  350. local MATERIAL = STUFF[3]
  351. local TRANSPARENCY = STUFF[5]
  352. if PART.ClassName == "Part" and PART ~= char.HumanoidRootPart then
  353. PART.Material = MATERIAL
  354. PART.Transparency = TRANSPARENCY
  355. end
  356. if PART.Parent ~= PARENT then
  357. char:FindFirstChildOfClass("Humanoid"):remove()
  358. PART.Parent = PARENT
  359. Humanoid = Instance.new("Humanoid",char)
  360. end
  361. end
  362. end
  363. end
  364. char.Humanoid.Died:connect(function()
  365. hurt:Play()
  366. refit()
  367. mouse1:Disconnect()
  368. mouse2:Disconnect()
  369. for i,v in pairs(effect:GetChildren()) do
  370. if v.ClassName == "Part" then
  371. v.Transparency = 0.7
  372. end
  373. end
  374. workspace.CurrentCamera.CameraSubject = char.Head
  375. generategui()
  376. HasDied = true
  377. Dead = true
  378. for i = 0,1, 0.03 do
  379. human2.C0 = human2.C0:lerp(CFrame.new(1.99999964, -3.00000095, 0, -0.00852799695, 0.999963641, 0, -0.999963641, -0.00852799695, 0, 0, 0, 1):inverse() + Vector3.new(0,1,0),i)
  380. game:GetService("RunService").RenderStepped:wait()
  381. end
  382. end)
  383. while true do
  384. game:GetService("RunService").RenderStepped:wait()
  385. if char.Humanoid.Health < 100 and not damaged and not Dead and not HasDied then
  386. reddamage(0.5)
  387. damaged = true
  388. wait(1)
  389. damaged = false
  390. char.Humanoid.Health = 100
  391. end
  392. if char.Humanoid.Health < 1 and Dead and HasDied then
  393. refit()
  394. for i,v in pairs(effect:GetChildren()) do
  395. if v.ClassName == "Part" then
  396. v.Transparency = 0.7
  397. end
  398. end
  399. end
  400. if Dead and HasDied then
  401. char.Humanoid.WalkSpeed = 0
  402. char.Humanoid.JumpPower = 0
  403. human2.Parent = char.Torso
  404. rhandweld.Parent = char.Torso
  405. end
  406. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement