Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --https://github.com/Mokiros/roblox-FE-compatibility
- if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
- local Player,Mouse,mouse,UserInputService,ContextActionService = owner
- local RealPlayer = Player
- 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
- -- Extracted from nebula hub by DOGGΩ#0018
- me = game:GetService("Players").LocalPlayer
- if script.Parent.className ~= "HopperBin" then
- h = Instance.new("HopperBin")
- h.Parent = me.Backpack
- h.Name = "Build IT"
- script.Parent = h
- end
- bin = script.Parent
- hold = false
- sel = false
- color = "Black"
- material = "Plastic"
- x = 1
- y = 1
- tran = 0
- ref = 0
- colours = {}
- materials = {"Plastic", "Wood", "Slate", "CorrodedMetal", "Concrete", "Ice", "Foil", "Grass", "DiamondPlate"}
- floor = {}
- for i=1,1032 do
- if BrickColor.new(i) ~= BrickColor.new("Medium stone grey") then
- table.insert(colours, tostring(BrickColor.new(i)))
- end
- end
- brick = Instance.new("Part")
- brick.Parent = bin
- brick.formFactor = 0
- brick.Size = Vector3.new(1,1,1)
- brick.Anchored = true
- brick.BrickColor = BrickColor.new(color)
- brick.TopSurface = 0
- brick.BottomSurface = 0
- brick.Material = material
- brick.CanCollide = false
- brick.Transparency = tran
- brick.Reflectance = ref
- brick.Size = Vector3.new(x,y,1)
- sph = Instance.new("SpecialMesh",brick)
- sph.MeshType = "Brick"
- sph.Scale = Vector3.new(x,y,1)
- mode = "Build"
- gui = false
- function lollero(vector)
- return Vector3.new(math.ceil(vector.x - 0.5), math.ceil(vector.y - 0.5), math.ceil(vector.z - 0.5))
- end
- function makegui()
- if gui == true then return end
- screen = Instance.new("ScreenGui")
- screen.Parent = me.PlayerGui
- screen.Name = "Build GUI"
- frame = Instance.new("Frame")
- frame.Parent = screen
- frame.Size = UDim2.new(1,0,0.078,0)
- frame.Position = UDim2.new(0,0,0,-1)
- frame.BackgroundColor3 = Color3.new(0.05,0.05,0.05)
- frame.BorderColor3 = Color3.new(0.17,0.17,0.17)
- local xx = 0.045
- local yy = 0.1
- for i=1, #colours do
- local button = Instance.new("TextButton",frame)
- button.Size = UDim2.new(0.014,0,0.26,0)
- button.Position = UDim2.new(xx,0,yy,0)
- button.BackgroundColor = BrickColor.new(colours[i])
- button.BorderSizePixel = 0
- button.Text = ""
- button.MouseButton1Click:connect(function()
- color = colours[i]
- end)
- xx = xx + 0.016
- if xx > 0.8 then
- xx = 0.045
- yy = yy + 0.3
- end
- end
- frame2 = Instance.new("Frame")
- frame2.Parent = screen
- frame2.Size = UDim2.new(0.1,0,1,0)
- frame2.Position = UDim2.new(0.9,0,0,-1)
- frame2.BackgroundColor3 = Color3.new(0.05,0.05,0.05)
- frame2.BorderColor3 = Color3.new(0.17,0.17,0.17)
- local yyy = 0.14
- for i=1, #materials do
- local butta = Instance.new("TextButton",frame2)
- butta.Size = UDim2.new(0.8,0,0.06,0)
- butta.Position = UDim2.new(0.1,0,yyy,0)
- butta.BackgroundColor3 = Color3.new(0.1,0.1,0.1)
- butta.Text = materials[i]
- butta.BorderColor3 = Color3.new(0.2,0.2,0.2)
- butta.TextColor3 = Color3.new(1,1,1)
- butta.MouseButton1Click:connect(function()
- material = materials[i]
- end)
- yyy = yyy + 0.067
- end
- floorbutton = Instance.new("TextButton",frame2)
- floorbutton.Size = UDim2.new(0.9,0,0.07,0)
- floorbutton.Position = UDim2.new(0.05,0,0.8,0)
- floorbutton.BackgroundColor3 = Color3.new(0.1,0.1,0.1)
- floorbutton.Text = "Done"
- floorbutton.BorderColor3 = Color3.new(0.2,0.2,0.2)
- floorbutton.TextColor3 = Color3.new(1,1,1)
- floorbutton.FontSize = "Size14"
- floorbutton.MouseButton1Click:connect(function()
- for i=1, #floor do
- floor[i].Parent = workspace
- end
- for i=1, #floor do
- table.remove(floor,1)
- end
- end)
- instructions = Instance.new("Frame",screen)
- instructions.Size = UDim2.new(1,0,0.08,0)
- instructions.Position = UDim2.new(0,0,0.92,0)
- instructions.BackgroundColor3 = Color3.new(0.1,0.1,0.1)
- text1 = Instance.new("TextLabel",instructions)
- text1.Size = UDim2.new(1,0,0.4,0)
- text1.Position = UDim2.new(0,0,0,0)
- text1.BackgroundTransparency = 1
- text1.FontSize = "Size18"
- text1.TextColor3 = Color3.new(1,1,1)
- text1.Text = "R, T, Z, X to resize, Y and U for transparency, E to remove gui."
- text2 = Instance.new("TextLabel",instructions)
- text2.Size = UDim2.new(1,0,0.4,0)
- text2.Position = UDim2.new(0,0,0.5,0)
- text2.BackgroundTransparency = 1
- text2.FontSize = "Size18"
- text2.TextColor3 = Color3.new(1,1,1)
- text2.Text = "B for build mode, F for deleting mode, M for edit mode."
- gui = true
- end
- bin.Selected:connect(function(mouse)
- sel = true
- brick.Parent = me.Character
- brick.CFrame = CFrame.new(mouse.Hit.p)
- coroutine.resume(coroutine.create(function()
- while sel do
- wait()
- brick.CFrame = CFrame.new(lollero(mouse.Hit.p)) * CFrame.new(0,y/2,0)
- brick.BrickColor = BrickColor.new(color)
- brick.Material = material
- brick.Transparency = tran
- brick.Reflectance = ref
- sph.Scale = Vector3.new(x,y,1)
- end
- end))
- mouse.KeyDown:connect(function(key)
- key = key:lower()
- if key == "q" then
- makegui()
- elseif key == "e" then
- local a = me.PlayerGui:GetChildren()
- for _,v in pairs(a) do
- if v.Name == "Build GUI" then
- v:remove()
- gui = false
- end
- end
- elseif key == "z" then
- if x > 1 then
- x = x - 1
- end
- elseif key == "x" then
- x = x + 1
- elseif key == "r" then
- if y > 1 then
- y = y - 1
- end
- elseif key == "t" then
- y = y + 1
- elseif key == "f" then
- mode = "Delete"
- elseif key == "b" then
- mode = "Build"
- elseif key == "m" then
- mode = "Edit"
- elseif key == "y" then
- tran = tran - 0.1
- if tran < 0 then
- tran = 0
- end
- elseif key == "u" then
- tran = tran + 0.1
- if tran > 1 then
- tran = 1
- end
- end
- end)
- mouse.Button1Down:connect(function()
- if mode == "Build" then
- if mouse.Target == nil then return end
- hold = true
- holdem = lollero(mouse.Hit.p)
- holdposition = holdem + Vector3.new(0,y/2,0)
- possa = holdposition
- local buildbrick = Instance.new("Part",me.Character)
- buildbrick.Name = "BuildBrick"
- buildbrick.formFactor = "Custom"
- buildbrick.Size = Vector3.new(x,y,1)
- buildbrick.TopSurface = 0
- buildbrick.BottomSurface = 0
- buildbrick.Anchored = true
- buildbrick.BrickColor = BrickColor.new(color)
- buildbrick.Transparency = tran
- buildbrick.Reflectance = ref
- buildbrick.Material = material
- buildbrick.CFrame = CFrame.new(holdposition)
- table.insert(floor,buildbrick)
- while hold do
- holdposition = holdem + Vector3.new(0,y/2,0)
- local poo = lollero(mouse.Hit.p)
- possa = poo + Vector3.new(0,y/2,0)
- local distance = (holdposition - possa).magnitude
- if distance > 600 then
- distance = 600
- end
- buildbrick.Size = Vector3.new(x,y,distance)
- buildbrick.CFrame = CFrame.new((possa + holdposition)/2, holdposition)
- wait()
- end
- elseif mode == "Delete" then
- if mouse.Target then
- local targ = mouse.Target
- if targ.Name == "BuildBrick" then
- targ:remove()
- end
- end
- elseif mode == "Edit" then
- if mouse.Target then
- local targ = mouse.Target
- if targ.Name == "BuildBrick" then
- targ.BrickColor = BrickColor.new(color)
- targ.Material = material
- targ.Transparency = tran
- targ.Reflectance = ref
- end
- end
- end
- end)
- mouse.Button1Up:connect(function()
- hold = false
- end)
- end)
- bin.Deselected:connect(function()
- hold = false
- sel = false
- brick.Parent = bin
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement