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 wait()
- print("[Self Building House] Assembling button...")
- local m = Instance.new("Model")
- m.Name = "Click me to build the house! :D"
- m.Parent = workspace
- local b = Instance.new("Part")
- b.Anchored = true
- b.TopSurface = "Smooth"
- b.BottomSurface = "Smooth"
- b.FormFactor = "Symmetric"
- b.Material = "DiamondPlate"
- b.BrickColor = BrickColor.new("Dark stone grey")
- b.Transparency = .5
- b.Size = Vector3.new(5,1,5)
- b.CFrame = CFrame.new(0,10.5,0)
- b.Parent = m
- for i=0,19 do
- wait()
- b.CFrame = b.CFrame - Vector3.new(0,.5,0)
- end
- b.Transparency = 0
- local c = Instance.new("Part")
- c.Anchored = true
- c.TopSurface = "Smooth"
- c.BottomSurface = "Smooth"
- c.FormFactor = "Symmetric"
- c.Material = "Neon"
- c.Name = "Head"
- c.BrickColor = BrickColor.new("Lime green")
- c.Transparency = .5
- c.Size = Vector3.new(3,1,3)
- c.CFrame = CFrame.new(0,10.5,0)
- c.Parent = m
- for i=0,17 do
- wait()
- c.CFrame = c.CFrame - Vector3.new(0,.5,0)
- end
- c.Transparency = 0
- local l = Instance.new("PointLight")
- l.Color = Color3.new(0,1,0)
- l.Range = 15
- l.Parent = c
- local n = Instance.new("Humanoid")
- n.Health = 0
- n.MaxHealth = 0
- n.Parent = m
- local d = Instance.new("ClickDetector",c)
- print("[Self Building House] The button is fully assembled")
- d.MouseClick:connect(function()
- print("[Self Building House] Building house...")
- d:Destroy()
- m.Name = "The house is being built..."
- c.BrickColor = BrickColor.new("Bright yellow")
- l.Color = Color3.new(1,1,0)
- local m2 = Instance.new("Model")
- m2.Name = "House"
- m2.Parent = workspace
- local p0 = Instance.new("Part")
- p0.Anchored = true
- p0.TopSurface = "Smooth"
- p0.BottomSurface = "Smooth"
- p0.FormFactor = "Symmetric"
- p0.Material = "Grass"
- p0.BrickColor = BrickColor.new("Dark green")
- p0.Transparency = .5
- p0.Size = Vector3.new(50,1,50)
- p0.CFrame = CFrame.new(0,10.5,35)
- p0.Parent = m2
- for i=0,19 do
- wait()
- p0.CFrame = p0.CFrame - Vector3.new(0,.5,0)
- end
- p0.Transparency = 0
- local p1 = Instance.new("Part")
- p1.Anchored = true
- p1.TopSurface = "Smooth"
- p1.BottomSurface = "Smooth"
- p1.FormFactor = "Symmetric"
- p1.Material = "WoodPlanks"
- p1.BrickColor = BrickColor.new("Medium blue")
- p1.Transparency = .5
- p1.Size = Vector3.new(25,3,15)
- p1.CFrame = CFrame.new(0,12.5,35)
- p1.Parent = m2
- for i=0,19 do
- wait()
- p1.CFrame = p1.CFrame - Vector3.new(0,.5,0)
- end
- p1.Transparency = 0
- local p2 = Instance.new("Part")
- p2.Anchored = true
- p2.TopSurface = "Smooth"
- p2.BottomSurface = "Smooth"
- p2.FormFactor = "Symmetric"
- p2.Material = "WoodPlanks"
- p2.BrickColor = BrickColor.new("Cool yellow")
- p2.Transparency = .5
- p2.Size = Vector3.new(1,15,15)
- p2.CFrame = CFrame.new(12,21.5,35)
- p2.Parent = m2
- for i=0,19 do
- wait()
- p2.CFrame = p2.CFrame - Vector3.new(0,.5,0)
- end
- p2.Transparency = 0
- local p3 = Instance.new("Part")
- p3.Anchored = true
- p3.TopSurface = "Smooth"
- p3.BottomSurface = "Smooth"
- p3.FormFactor = "Symmetric"
- p3.Material = "WoodPlanks"
- p3.BrickColor = BrickColor.new("Cool yellow")
- p3.Transparency = .5
- p3.Size = Vector3.new(1,15,15)
- p3.CFrame = CFrame.new(-12,21.5,35)
- p3.Parent = m2
- for i=0,19 do
- wait()
- p3.CFrame = p3.CFrame - Vector3.new(0,.5,0)
- end
- p3.Transparency = 0
- local p4 = Instance.new("Part")
- p4.Anchored = true
- p4.TopSurface = "Smooth"
- p4.BottomSurface = "Smooth"
- p4.FormFactor = "Symmetric"
- p4.Material = "WoodPlanks"
- p4.BrickColor = BrickColor.new("Cool yellow")
- p4.Transparency = .5
- p4.Size = Vector3.new(23,15,1)
- p4.CFrame = CFrame.new(0,21.5,42)
- p4.Parent = m2
- for i=0,19 do
- wait()
- p4.CFrame = p4.CFrame - Vector3.new(0,.5,0)
- end
- p4.Transparency = 0
- local p5 = Instance.new("Part")
- p5.Anchored = true
- p5.TopSurface = "Smooth"
- p5.BottomSurface = "Smooth"
- p5.FormFactor = "Symmetric"
- p5.Material = "WoodPlanks"
- p5.BrickColor = BrickColor.new("Cool yellow")
- p5.Transparency = .5
- p5.Size = Vector3.new(7,15,1)
- p5.CFrame = CFrame.new(8,21.5,28)
- p5.Parent = m2
- for i=0,19 do
- wait()
- p5.CFrame = p5.CFrame - Vector3.new(0,.5,0)
- end
- p5.Transparency = 0
- local p6 = Instance.new("Part")
- p6.Anchored = true
- p6.TopSurface = "Smooth"
- p6.BottomSurface = "Smooth"
- p6.FormFactor = "Symmetric"
- p6.Material = "WoodPlanks"
- p6.BrickColor = BrickColor.new("Cool yellow")
- p6.Transparency = .5
- p6.Size = Vector3.new(7,15,1)
- p6.CFrame = CFrame.new(-8,21.5,28)
- p6.Parent = m2
- for i=0,19 do
- wait()
- p6.CFrame = p6.CFrame - Vector3.new(0,.5,0)
- end
- p6.Transparency = 0
- local p7 = Instance.new("Part")
- p7.Anchored = true
- p7.TopSurface = "Smooth"
- p7.BottomSurface = "Smooth"
- p7.FormFactor = "Symmetric"
- p7.Material = "WoodPlanks"
- p7.BrickColor = BrickColor.new("Cool yellow")
- p7.Transparency = .5
- p7.Size = Vector3.new(9,5,1)
- p7.CFrame = CFrame.new(0,26.5,28)
- p7.Parent = m2
- for i=0,19 do
- wait()
- p7.CFrame = p7.CFrame - Vector3.new(0,.5,0)
- end
- p7.Transparency = 0
- local p8 = Instance.new("Part")
- p8.Anchored = true
- p8.TopSurface = "Smooth"
- p8.BottomSurface = "Smooth"
- p8.FormFactor = "Symmetric"
- p8.Material = "WoodPlanks"
- p8.BrickColor = BrickColor.new("Bright red")
- p8.Transparency = .5
- p8.Size = Vector3.new(25,1,15)
- p8.CFrame = CFrame.new(0,29.5,35)
- p8.Parent = m2
- for i=0,19 do
- wait()
- p8.CFrame = p8.CFrame - Vector3.new(0,.5,0)
- end
- p8.Transparency = 0
- local p9 = Instance.new("Part")
- p9.Anchored = true
- p9.TopSurface = "Smooth"
- p9.BottomSurface = "Smooth"
- p9.FormFactor = "Symmetric"
- p9.Material = "Slate"
- p9.BrickColor = BrickColor.new("Dark stone grey")
- p9.Transparency = .5
- p9.Size = Vector3.new(9,3,2)
- p9.CFrame = CFrame.new(0,12.5,26.5)
- p9.Parent = m2
- for i=0,19 do
- wait()
- p9.CFrame = p9.CFrame - Vector3.new(0,.5,0)
- end
- p9.Transparency = 0
- local p10 = Instance.new("Part")
- p10.Anchored = true
- p10.TopSurface = "Smooth"
- p10.BottomSurface = "Smooth"
- p10.FormFactor = "Symmetric"
- p10.Material = "Slate"
- p10.BrickColor = BrickColor.new("Dark stone grey")
- p10.Transparency = .5
- p10.Size = Vector3.new(9,2,2)
- p10.CFrame = CFrame.new(0,12,24.5)
- p10.Parent = m2
- for i=0,19 do
- wait()
- p10.CFrame = p10.CFrame - Vector3.new(0,.5,0)
- end
- p10.Transparency = 0
- local p11 = Instance.new("Part")
- p11.Anchored = true
- p11.TopSurface = "Smooth"
- p11.BottomSurface = "Smooth"
- p11.FormFactor = "Symmetric"
- p11.Material = "Slate"
- p11.BrickColor = BrickColor.new("Dark stone grey")
- p11.Transparency = .5
- p11.Size = Vector3.new(9,1,2)
- p11.CFrame = CFrame.new(0,11.5,22.5)
- p11.Parent = m2
- for i=0,19 do
- wait()
- p11.CFrame = p11.CFrame - Vector3.new(0,.5,0)
- end
- p11.Transparency = 0
- print("[Self Building House] The house is fully built")
- m.Name = "The house is fully built! :D"
- c.BrickColor = BrickColor.new("Really red")
- l.Color = Color3.new(1,0,0)
- wait(3)
- local s = Instance.new("Sound")
- s.SoundId = "rbxassetid://12221984"
- s.PlayOnRemove = true
- s.Parent = workspace
- s:Destroy()
- local e = Instance.new("Explosion")
- e.BlastRadius = 0
- e.BlastPressure = 0
- e.Position = b.Position
- e.Parent = workspace
- m:Destroy()
- script:Destroy()
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement