Advertisement
zXzGamePROzXz

Untitled

Dec 30th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.14 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
  6.  
  7. -- Extracted from nebula hub by DOGGΩ#0018
  8. me = game:GetService("Players").LocalPlayer
  9.  
  10. if script.Parent.className ~= "HopperBin" then
  11. h = Instance.new("HopperBin")
  12. h.Parent = me.Backpack
  13. h.Name = "Build IT"
  14. script.Parent = h
  15. end
  16.  
  17. bin = script.Parent
  18. hold = false
  19. sel = false
  20.  
  21. color = "Black"
  22. material = "Plastic"
  23. x = 1
  24. y = 1
  25. tran = 0
  26. ref = 0
  27.  
  28. colours = {}
  29. materials = {"Plastic", "Wood", "Slate", "CorrodedMetal", "Concrete", "Ice", "Foil", "Grass", "DiamondPlate"}
  30. floor = {}
  31.  
  32. for i=1,1032 do
  33. if BrickColor.new(i) ~= BrickColor.new("Medium stone grey") then
  34. table.insert(colours, tostring(BrickColor.new(i)))
  35. end
  36. end
  37.  
  38. brick = Instance.new("Part")
  39. brick.Parent = bin
  40. brick.formFactor = 0
  41. brick.Size = Vector3.new(1,1,1)
  42. brick.Anchored = true
  43. brick.BrickColor = BrickColor.new(color)
  44. brick.TopSurface = 0
  45. brick.BottomSurface = 0
  46. brick.Material = material
  47. brick.CanCollide = false
  48. brick.Transparency = tran
  49. brick.Reflectance = ref
  50. brick.Size = Vector3.new(x,y,1)
  51. sph = Instance.new("SpecialMesh",brick)
  52. sph.MeshType = "Brick"
  53. sph.Scale = Vector3.new(x,y,1)
  54.  
  55. mode = "Build"
  56. gui = false
  57.  
  58. function lollero(vector)
  59. return Vector3.new(math.ceil(vector.x - 0.5), math.ceil(vector.y - 0.5), math.ceil(vector.z - 0.5))
  60. end
  61.  
  62. function makegui()
  63. if gui == true then return end
  64. screen = Instance.new("ScreenGui")
  65. screen.Parent = me.PlayerGui
  66. screen.Name = "Build GUI"
  67. frame = Instance.new("Frame")
  68. frame.Parent = screen
  69. frame.Size = UDim2.new(1,0,0.078,0)
  70. frame.Position = UDim2.new(0,0,0,-1)
  71. frame.BackgroundColor3 = Color3.new(0.05,0.05,0.05)
  72. frame.BorderColor3 = Color3.new(0.17,0.17,0.17)
  73. local xx = 0.045
  74. local yy = 0.1
  75. for i=1, #colours do
  76. local button = Instance.new("TextButton",frame)
  77. button.Size = UDim2.new(0.014,0,0.26,0)
  78. button.Position = UDim2.new(xx,0,yy,0)
  79. button.BackgroundColor = BrickColor.new(colours[i])
  80. button.BorderSizePixel = 0
  81. button.Text = ""
  82. button.MouseButton1Click:connect(function()
  83. color = colours[i]
  84. end)
  85. xx = xx + 0.016
  86. if xx > 0.8 then
  87. xx = 0.045
  88. yy = yy + 0.3
  89. end
  90. end
  91. frame2 = Instance.new("Frame")
  92. frame2.Parent = screen
  93. frame2.Size = UDim2.new(0.1,0,1,0)
  94. frame2.Position = UDim2.new(0.9,0,0,-1)
  95. frame2.BackgroundColor3 = Color3.new(0.05,0.05,0.05)
  96. frame2.BorderColor3 = Color3.new(0.17,0.17,0.17)
  97. local yyy = 0.14
  98. for i=1, #materials do
  99. local butta = Instance.new("TextButton",frame2)
  100. butta.Size = UDim2.new(0.8,0,0.06,0)
  101. butta.Position = UDim2.new(0.1,0,yyy,0)
  102. butta.BackgroundColor3 = Color3.new(0.1,0.1,0.1)
  103. butta.Text = materials[i]
  104. butta.BorderColor3 = Color3.new(0.2,0.2,0.2)
  105. butta.TextColor3 = Color3.new(1,1,1)
  106. butta.MouseButton1Click:connect(function()
  107. material = materials[i]
  108. end)
  109. yyy = yyy + 0.067
  110. end
  111. floorbutton = Instance.new("TextButton",frame2)
  112. floorbutton.Size = UDim2.new(0.9,0,0.07,0)
  113. floorbutton.Position = UDim2.new(0.05,0,0.8,0)
  114. floorbutton.BackgroundColor3 = Color3.new(0.1,0.1,0.1)
  115. floorbutton.Text = "Done"
  116. floorbutton.BorderColor3 = Color3.new(0.2,0.2,0.2)
  117. floorbutton.TextColor3 = Color3.new(1,1,1)
  118. floorbutton.FontSize = "Size14"
  119. floorbutton.MouseButton1Click:connect(function()
  120. for i=1, #floor do
  121. floor[i].Parent = workspace
  122. end
  123. for i=1, #floor do
  124. table.remove(floor,1)
  125. end
  126. end)
  127. instructions = Instance.new("Frame",screen)
  128. instructions.Size = UDim2.new(1,0,0.08,0)
  129. instructions.Position = UDim2.new(0,0,0.92,0)
  130. instructions.BackgroundColor3 = Color3.new(0.1,0.1,0.1)
  131. text1 = Instance.new("TextLabel",instructions)
  132. text1.Size = UDim2.new(1,0,0.4,0)
  133. text1.Position = UDim2.new(0,0,0,0)
  134. text1.BackgroundTransparency = 1
  135. text1.FontSize = "Size18"
  136. text1.TextColor3 = Color3.new(1,1,1)
  137. text1.Text = "R, T, Z, X to resize, Y and U for transparency, E to remove gui."
  138. text2 = Instance.new("TextLabel",instructions)
  139. text2.Size = UDim2.new(1,0,0.4,0)
  140. text2.Position = UDim2.new(0,0,0.5,0)
  141. text2.BackgroundTransparency = 1
  142. text2.FontSize = "Size18"
  143. text2.TextColor3 = Color3.new(1,1,1)
  144. text2.Text = "B for build mode, F for deleting mode, M for edit mode."
  145. gui = true
  146. end
  147.  
  148. bin.Selected:connect(function(mouse)
  149. sel = true
  150. brick.Parent = me.Character
  151. brick.CFrame = CFrame.new(mouse.Hit.p)
  152. coroutine.resume(coroutine.create(function()
  153. while sel do
  154. wait()
  155. brick.CFrame = CFrame.new(lollero(mouse.Hit.p)) * CFrame.new(0,y/2,0)
  156. brick.BrickColor = BrickColor.new(color)
  157. brick.Material = material
  158. brick.Transparency = tran
  159. brick.Reflectance = ref
  160. sph.Scale = Vector3.new(x,y,1)
  161. end
  162. end))
  163. mouse.KeyDown:connect(function(key)
  164. key = key:lower()
  165. if key == "q" then
  166. makegui()
  167. elseif key == "e" then
  168. local a = me.PlayerGui:GetChildren()
  169. for _,v in pairs(a) do
  170. if v.Name == "Build GUI" then
  171. v:remove()
  172. gui = false
  173. end
  174. end
  175. elseif key == "z" then
  176. if x > 1 then
  177. x = x - 1
  178. end
  179. elseif key == "x" then
  180. x = x + 1
  181. elseif key == "r" then
  182. if y > 1 then
  183. y = y - 1
  184. end
  185. elseif key == "t" then
  186. y = y + 1
  187. elseif key == "f" then
  188. mode = "Delete"
  189. elseif key == "b" then
  190. mode = "Build"
  191. elseif key == "m" then
  192. mode = "Edit"
  193. elseif key == "y" then
  194. tran = tran - 0.1
  195. if tran < 0 then
  196. tran = 0
  197. end
  198. elseif key == "u" then
  199. tran = tran + 0.1
  200. if tran > 1 then
  201. tran = 1
  202. end
  203. end
  204. end)
  205. mouse.Button1Down:connect(function()
  206. if mode == "Build" then
  207. if mouse.Target == nil then return end
  208. hold = true
  209. holdem = lollero(mouse.Hit.p)
  210. holdposition = holdem + Vector3.new(0,y/2,0)
  211. possa = holdposition
  212. local buildbrick = Instance.new("Part",me.Character)
  213. buildbrick.Name = "BuildBrick"
  214. buildbrick.formFactor = "Custom"
  215. buildbrick.Size = Vector3.new(x,y,1)
  216. buildbrick.TopSurface = 0
  217. buildbrick.BottomSurface = 0
  218. buildbrick.Anchored = true
  219. buildbrick.BrickColor = BrickColor.new(color)
  220. buildbrick.Transparency = tran
  221. buildbrick.Reflectance = ref
  222. buildbrick.Material = material
  223. buildbrick.CFrame = CFrame.new(holdposition)
  224. table.insert(floor,buildbrick)
  225. while hold do
  226. holdposition = holdem + Vector3.new(0,y/2,0)
  227. local poo = lollero(mouse.Hit.p)
  228. possa = poo + Vector3.new(0,y/2,0)
  229. local distance = (holdposition - possa).magnitude
  230. if distance > 600 then
  231. distance = 600
  232. end
  233. buildbrick.Size = Vector3.new(x,y,distance)
  234. buildbrick.CFrame = CFrame.new((possa + holdposition)/2, holdposition)
  235. wait()
  236. end
  237. elseif mode == "Delete" then
  238. if mouse.Target then
  239. local targ = mouse.Target
  240. if targ.Name == "BuildBrick" then
  241. targ:remove()
  242. end
  243. end
  244. elseif mode == "Edit" then
  245. if mouse.Target then
  246. local targ = mouse.Target
  247. if targ.Name == "BuildBrick" then
  248. targ.BrickColor = BrickColor.new(color)
  249. targ.Material = material
  250. targ.Transparency = tran
  251. targ.Reflectance = ref
  252. end
  253. end
  254. end
  255. end)
  256. mouse.Button1Up:connect(function()
  257. hold = false
  258. end)
  259. end)
  260.  
  261. bin.Deselected:connect(function()
  262. hold = false
  263. sel = false
  264. brick.Parent = bin
  265. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement