Advertisement
lafur

Untitled

Sep 12th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.90 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,Mouse,mouse,UserInputService,ContextActionService = owner
  4. local RealPlayer = Player
  5. do print("FE Compatibility code by Mokiros")local a=RealPlayer;script.Parent=a.Character;local b=Instance.new("RemoteEvent")b.Name="UserInput_Event"local function c()local d={_fakeEvent=true,Functions={},Connect=function(self,e)table.insert(self.Functions,e)end}d.connect=d.Connect;return d end;local f={Target=nil,Hit=CFrame.new(),KeyUp=c(),KeyDown=c(),Button1Up=c(),Button1Down=c(),Button2Up=c(),Button2Down=c()}local g={InputBegan=c(),InputEnded=c()}local CAS={Actions={},BindAction=function(self,h,i,j,...)CAS.Actions[h]=i and{Name=h,Function=i,Keys={...}}or nil end}CAS.UnbindAction=CAS.BindAction;local function k(self,l,...)local d=f[l]if d and d._fakeEvent then for m,e in pairs(d.Functions)do e(...)end end end;f.TrigEvent=k;g.TrigEvent=k;b.OnServerEvent:Connect(function(n,o)if n~=a then return end;f.Target=o.Target;f.Hit=o.Hit;if not o.isMouse then local p=o.UserInputState==Enum.UserInputState.Begin;if o.UserInputType==Enum.UserInputType.MouseButton1 then return f:TrigEvent(p and"Button1Down"or"Button1Up")end;if o.UserInputType==Enum.UserInputType.MouseButton2 then return f:TrigEvent(p and"Button2Down"or"Button2Up")end;for m,d in pairs(CAS.Actions)do for m,q in pairs(d.Keys)do if q==o.KeyCode then d.Function(d.Name,o.UserInputState,o)end end end;f:TrigEvent(p and"KeyDown"or"KeyUp",o.KeyCode.Name:lower())g:TrigEvent(p and"InputBegan"or"InputEnded",o,false)end end)b.Parent=NLS([==[local a=game:GetService("Players").LocalPlayer;local b=script:WaitForChild("UserInput_Event")local c=a:GetMouse()local d=game:GetService("UserInputService")local e=function(f,g)if g then return end;b:FireServer({KeyCode=f.KeyCode,UserInputType=f.UserInputType,UserInputState=f.UserInputState,Hit=c.Hit,Target=c.Target})end;d.InputBegan:Connect(e)d.InputEnded:Connect(e)local h,i;while wait(1/30)do if h~=c.Hit or i~=c.Target then h,i=c.Hit,c.Target;b:FireServer({isMouse=true,Target=i,Hit=h})end end]==],Player.Character)local r=game;local s={__index=function(self,q)local t=rawget(self,"_RealService")if t then return typeof(t[q])=="function"and function(m,...)return t[q](t,...)end or t[q]end end,__newindex=function(self,q,u)local t=rawget(self,"_RealService")if t then t[q]=u end end}local function v(d,w)d._RealService=typeof(w)=="string"and r:GetService(w)or w;return setmetatable(d,s)end;local x={GetService=function(self,t)return rawget(self,t)or r:GetService(t)end,Players=v({LocalPlayer=v({GetMouse=function(self)return f end},Player)},"Players"),UserInputService=v(g,"UserInputService"),ContextActionService=v(CAS,"ContextActionService"),RunService=v({_btrs={},RenderStepped=r:GetService("RunService").Heartbeat,BindToRenderStep=function(self,h,m,i)self._btrs[h]=self.Heartbeat:Connect(i)end,UnbindFromRenderStep=function(self,h)self._btrs[h]:Disconnect()end},"RunService")}rawset(x.Players,"localPlayer",x.Players.LocalPlayer)x.service=x.GetService;v(x,game)game,owner=x,x.Players.LocalPlayer end wait()
  6. print("[Self Building House] Assembling button...")
  7. local m = Instance.new("Model")
  8. m.Name = "Click me to build the house! :D"
  9. m.Parent = workspace
  10. local b = Instance.new("Part")
  11. b.Anchored = true
  12. b.TopSurface = "Smooth"
  13. b.BottomSurface = "Smooth"
  14. b.FormFactor = "Symmetric"
  15. b.Material = "DiamondPlate"
  16. b.BrickColor = BrickColor.new("Dark stone grey")
  17. b.Transparency = .5
  18. b.Size = Vector3.new(5,1,5)
  19. b.CFrame = CFrame.new(0,10.5,0)
  20. b.Parent = m
  21. for i=0,19 do
  22. wait()
  23. b.CFrame = b.CFrame - Vector3.new(0,.5,0)
  24. end
  25. b.Transparency = 0
  26. local c = Instance.new("Part")
  27. c.Anchored = true
  28. c.TopSurface = "Smooth"
  29. c.BottomSurface = "Smooth"
  30. c.FormFactor = "Symmetric"
  31. c.Material = "Neon"
  32. c.Name = "Head"
  33. c.BrickColor = BrickColor.new("Lime green")
  34. c.Transparency = .5
  35. c.Size = Vector3.new(3,1,3)
  36. c.CFrame = CFrame.new(0,10.5,0)
  37. c.Parent = m
  38. for i=0,17 do
  39. wait()
  40. c.CFrame = c.CFrame - Vector3.new(0,.5,0)
  41. end
  42. c.Transparency = 0
  43. local l = Instance.new("PointLight")
  44. l.Color = Color3.new(0,1,0)
  45. l.Range = 15
  46. l.Parent = c
  47. local n = Instance.new("Humanoid")
  48. n.Health = 0
  49. n.MaxHealth = 0
  50. n.Parent = m
  51. local d = Instance.new("ClickDetector",c)
  52. print("[Self Building House] The button is fully assembled")
  53. d.MouseClick:connect(function()
  54. print("[Self Building House] Building house...")
  55. d:Destroy()
  56. m.Name = "The house is being built..."
  57. c.BrickColor = BrickColor.new("Bright yellow")
  58. l.Color = Color3.new(1,1,0)
  59. local m2 = Instance.new("Model")
  60. m2.Name = "House"
  61. m2.Parent = workspace
  62. local p0 = Instance.new("Part")
  63. p0.Anchored = true
  64. p0.TopSurface = "Smooth"
  65. p0.BottomSurface = "Smooth"
  66. p0.FormFactor = "Symmetric"
  67. p0.Material = "Grass"
  68. p0.BrickColor = BrickColor.new("Dark green")
  69. p0.Transparency = .5
  70. p0.Size = Vector3.new(50,1,50)
  71. p0.CFrame = CFrame.new(0,10.5,35)
  72. p0.Parent = m2
  73. for i=0,19 do
  74. wait()
  75. p0.CFrame = p0.CFrame - Vector3.new(0,.5,0)
  76. end
  77. p0.Transparency = 0
  78. local p1 = Instance.new("Part")
  79. p1.Anchored = true
  80. p1.TopSurface = "Smooth"
  81. p1.BottomSurface = "Smooth"
  82. p1.FormFactor = "Symmetric"
  83. p1.Material = "WoodPlanks"
  84. p1.BrickColor = BrickColor.new("Medium blue")
  85. p1.Transparency = .5
  86. p1.Size = Vector3.new(25,3,15)
  87. p1.CFrame = CFrame.new(0,12.5,35)
  88. p1.Parent = m2
  89. for i=0,19 do
  90. wait()
  91. p1.CFrame = p1.CFrame - Vector3.new(0,.5,0)
  92. end
  93. p1.Transparency = 0
  94. local p2 = Instance.new("Part")
  95. p2.Anchored = true
  96. p2.TopSurface = "Smooth"
  97. p2.BottomSurface = "Smooth"
  98. p2.FormFactor = "Symmetric"
  99. p2.Material = "WoodPlanks"
  100. p2.BrickColor = BrickColor.new("Cool yellow")
  101. p2.Transparency = .5
  102. p2.Size = Vector3.new(1,15,15)
  103. p2.CFrame = CFrame.new(12,21.5,35)
  104. p2.Parent = m2
  105. for i=0,19 do
  106. wait()
  107. p2.CFrame = p2.CFrame - Vector3.new(0,.5,0)
  108. end
  109. p2.Transparency = 0
  110. local p3 = Instance.new("Part")
  111. p3.Anchored = true
  112. p3.TopSurface = "Smooth"
  113. p3.BottomSurface = "Smooth"
  114. p3.FormFactor = "Symmetric"
  115. p3.Material = "WoodPlanks"
  116. p3.BrickColor = BrickColor.new("Cool yellow")
  117. p3.Transparency = .5
  118. p3.Size = Vector3.new(1,15,15)
  119. p3.CFrame = CFrame.new(-12,21.5,35)
  120. p3.Parent = m2
  121. for i=0,19 do
  122. wait()
  123. p3.CFrame = p3.CFrame - Vector3.new(0,.5,0)
  124. end
  125. p3.Transparency = 0
  126. local p4 = Instance.new("Part")
  127. p4.Anchored = true
  128. p4.TopSurface = "Smooth"
  129. p4.BottomSurface = "Smooth"
  130. p4.FormFactor = "Symmetric"
  131. p4.Material = "WoodPlanks"
  132. p4.BrickColor = BrickColor.new("Cool yellow")
  133. p4.Transparency = .5
  134. p4.Size = Vector3.new(23,15,1)
  135. p4.CFrame = CFrame.new(0,21.5,42)
  136. p4.Parent = m2
  137. for i=0,19 do
  138. wait()
  139. p4.CFrame = p4.CFrame - Vector3.new(0,.5,0)
  140. end
  141. p4.Transparency = 0
  142. local p5 = Instance.new("Part")
  143. p5.Anchored = true
  144. p5.TopSurface = "Smooth"
  145. p5.BottomSurface = "Smooth"
  146. p5.FormFactor = "Symmetric"
  147. p5.Material = "WoodPlanks"
  148. p5.BrickColor = BrickColor.new("Cool yellow")
  149. p5.Transparency = .5
  150. p5.Size = Vector3.new(7,15,1)
  151. p5.CFrame = CFrame.new(8,21.5,28)
  152. p5.Parent = m2
  153. for i=0,19 do
  154. wait()
  155. p5.CFrame = p5.CFrame - Vector3.new(0,.5,0)
  156. end
  157. p5.Transparency = 0
  158. local p6 = Instance.new("Part")
  159. p6.Anchored = true
  160. p6.TopSurface = "Smooth"
  161. p6.BottomSurface = "Smooth"
  162. p6.FormFactor = "Symmetric"
  163. p6.Material = "WoodPlanks"
  164. p6.BrickColor = BrickColor.new("Cool yellow")
  165. p6.Transparency = .5
  166. p6.Size = Vector3.new(7,15,1)
  167. p6.CFrame = CFrame.new(-8,21.5,28)
  168. p6.Parent = m2
  169. for i=0,19 do
  170. wait()
  171. p6.CFrame = p6.CFrame - Vector3.new(0,.5,0)
  172. end
  173. p6.Transparency = 0
  174. local p7 = Instance.new("Part")
  175. p7.Anchored = true
  176. p7.TopSurface = "Smooth"
  177. p7.BottomSurface = "Smooth"
  178. p7.FormFactor = "Symmetric"
  179. p7.Material = "WoodPlanks"
  180. p7.BrickColor = BrickColor.new("Cool yellow")
  181. p7.Transparency = .5
  182. p7.Size = Vector3.new(9,5,1)
  183. p7.CFrame = CFrame.new(0,26.5,28)
  184. p7.Parent = m2
  185. for i=0,19 do
  186. wait()
  187. p7.CFrame = p7.CFrame - Vector3.new(0,.5,0)
  188. end
  189. p7.Transparency = 0
  190. local p8 = Instance.new("Part")
  191. p8.Anchored = true
  192. p8.TopSurface = "Smooth"
  193. p8.BottomSurface = "Smooth"
  194. p8.FormFactor = "Symmetric"
  195. p8.Material = "WoodPlanks"
  196. p8.BrickColor = BrickColor.new("Bright red")
  197. p8.Transparency = .5
  198. p8.Size = Vector3.new(25,1,15)
  199. p8.CFrame = CFrame.new(0,29.5,35)
  200. p8.Parent = m2
  201. for i=0,19 do
  202. wait()
  203. p8.CFrame = p8.CFrame - Vector3.new(0,.5,0)
  204. end
  205. p8.Transparency = 0
  206. local p9 = Instance.new("Part")
  207. p9.Anchored = true
  208. p9.TopSurface = "Smooth"
  209. p9.BottomSurface = "Smooth"
  210. p9.FormFactor = "Symmetric"
  211. p9.Material = "Slate"
  212. p9.BrickColor = BrickColor.new("Dark stone grey")
  213. p9.Transparency = .5
  214. p9.Size = Vector3.new(9,3,2)
  215. p9.CFrame = CFrame.new(0,12.5,26.5)
  216. p9.Parent = m2
  217. for i=0,19 do
  218. wait()
  219. p9.CFrame = p9.CFrame - Vector3.new(0,.5,0)
  220. end
  221. p9.Transparency = 0
  222. local p10 = Instance.new("Part")
  223. p10.Anchored = true
  224. p10.TopSurface = "Smooth"
  225. p10.BottomSurface = "Smooth"
  226. p10.FormFactor = "Symmetric"
  227. p10.Material = "Slate"
  228. p10.BrickColor = BrickColor.new("Dark stone grey")
  229. p10.Transparency = .5
  230. p10.Size = Vector3.new(9,2,2)
  231. p10.CFrame = CFrame.new(0,12,24.5)
  232. p10.Parent = m2
  233. for i=0,19 do
  234. wait()
  235. p10.CFrame = p10.CFrame - Vector3.new(0,.5,0)
  236. end
  237. p10.Transparency = 0
  238. local p11 = Instance.new("Part")
  239. p11.Anchored = true
  240. p11.TopSurface = "Smooth"
  241. p11.BottomSurface = "Smooth"
  242. p11.FormFactor = "Symmetric"
  243. p11.Material = "Slate"
  244. p11.BrickColor = BrickColor.new("Dark stone grey")
  245. p11.Transparency = .5
  246. p11.Size = Vector3.new(9,1,2)
  247. p11.CFrame = CFrame.new(0,11.5,22.5)
  248. p11.Parent = m2
  249. for i=0,19 do
  250. wait()
  251. p11.CFrame = p11.CFrame - Vector3.new(0,.5,0)
  252. end
  253. p11.Transparency = 0
  254. print("[Self Building House] The house is fully built")
  255. m.Name = "The house is fully built! :D"
  256. c.BrickColor = BrickColor.new("Really red")
  257. l.Color = Color3.new(1,0,0)
  258. wait(3)
  259. local s = Instance.new("Sound")
  260. s.SoundId = "rbxassetid://12221984"
  261. s.PlayOnRemove = true
  262. s.Parent = workspace
  263. s:Destroy()
  264. local e = Instance.new("Explosion")
  265. e.BlastRadius = 0
  266. e.BlastPressure = 0
  267. e.Position = b.Position
  268. e.Parent = workspace
  269. m:Destroy()
  270. script:Destroy()
  271. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement