lafur

Untitled

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