Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- model = Instance.new("Model",workspace)
- model.Name = "vrhouse"
- function newP(cfX,cfY,cfZ,sX,sY,sZ,colorname,matname,transp)
- local newPI = Instance.new("Part",model)
- newPI.Size = Vector3.new(sX,sY,sZ)
- newPI.CFrame = CFrame.new(cfX,cfY,cfZ)
- newPI.BrickColor = BrickColor.new(colorname)
- newPI.Transparency = transp
- if matname == "Brick" then
- newPI.Material = Enum.Material.Brick
- elseif matname == "Cobblestone" then
- newPI.Material = Enum.Material.Cobblestone
- elseif matname == "Concrete" then
- newPI.Material = Enum.Material.Concrete
- elseif matname == "Corroded metal" then
- newPI.Material = Enum.Material.CorrodedMetal
- elseif matname == "Diamond plate" then
- newPI.Material = Enum.Material.DiamondPlate
- elseif matname == "Fabric" then
- newPI.Material = Enum.Material.Fabric
- elseif matname == "Foil" then
- newPI.Material = Enum.Material.Foil
- elseif matname == "Forcefield" then
- newPI.Material = Enum.Material.Forcefield
- elseif matname == "Grass" then
- newPI.Material = Enum.Material.Grass
- elseif matname == "Glass" then
- newPI.Material = Enum.Material.Glass
- elseif matname == "Granite" then
- newPI.Material = Enum.Material.Granite
- elseif matname == "Ice" then
- newPI.Material = Enum.Material.Ice
- elseif matname == "Marble" then
- newPI.Material = Enum.Material.Marble
- elseif matname == "Metal" then
- newPI.Material = Enu.Material.Metal
- elseif matname == "Neon" then
- newPI.Material = Enum.Material.Neon
- elseif matname == "Pebble" then
- newPI.Material = Enum.Material.Pebble
- elseif matname == "Plastic" then
- newPI.Material = Enum.Material.Plastic
- elseif matname == "Sand" then
- newPI.Material = Enum.Material.Sand
- elseif matname == "Slate" then
- newPI.Material = Enum.Material.Slate
- elseif matname == "Wood planks" then
- newPI.Material = Enum.Material.WoodPlanks
- elseif matname == "Wood" then
- newPI.Material = Enum.Material.Wood
- elseif matname == "Smooth plastic" then
- newPI.Material = Enum.Material.SmoothPlastic
- else end
- newPI.TopSurface = Enum.SurfaceType.Smooth
- newPI.BottomSurface = Enum.SurfaceType.Smooth
- newPI.Anchored = true
- end
- function adjustP(partdirectory,cfX,cfY,cfZ,sX,sY,sZ,colorname,matname,transp)
- local newPI = partdirectory
- newPI.Size = Vector3.new(sX,sY,sZ)
- newPI.CFrame = CFrame.new(cfX,cfY,cfZ)
- newPI.BrickColor = BrickColor.new(colorname)
- newPI.Transparency = transp
- if matname == "Brick" then
- newPI.Material = Enum.Material.Brick
- elseif matname == "Cobblestone" then
- newPI.Material = Enum.Material.Cobblestone
- elseif matname == "Concrete" then
- newPI.Material = Enum.Material.Concrete
- elseif matname == "Corroded metal" then
- newPI.Material = Enum.Material.CorrodedMetal
- elseif matname == "Diamond plate" then
- newPI.Material = Enum.Material.DiamondPlate
- elseif matname == "Fabric" then
- newPI.Material = Enum.Material.Fabric
- elseif matname == "Foil" then
- newPI.Material = Enum.Material.Foil
- elseif matname == "Forcefield" then
- newPI.Material = Enum.Material.Forcefield
- elseif matname == "Grass" then
- newPI.Material = Enum.Material.Grass
- elseif matname == "Glass" then
- newPI.Material = Enum.Material.Glass
- elseif matname == "Granite" then
- newPI.Material = Enum.Material.Granite
- elseif matname == "Ice" then
- newPI.Material = Enum.Material.Ice
- elseif matname == "Marble" then
- newPI.Material = Enum.Material.Marble
- elseif matname == "Metal" then
- newPI.Material = Enu.Material.Metal
- elseif matname == "Neon" then
- newPI.Material = Enum.Material.Neon
- elseif matname == "Pebble" then
- newPI.Material = Enum.Material.Pebble
- elseif matname == "Plastic" then
- newPI.Material = Enum.Material.Plastic
- elseif matname == "Sand" then
- newPI.Material = Enum.Material.Sand
- elseif matname == "Slate" then
- newPI.Material = Enum.Material.Slate
- elseif matname == "Wood planks" then
- newPI.Material = Enum.Material.WoodPlanks
- elseif matname == "Wood" then
- newPI.Material = Enum.Material.Wood
- elseif matname == "Smooth plastic" then
- newPI.Material = Enum.Material.SmoothPlastic
- else end
- newPI.TopSurface = Enum.SurfaceType.Smooth
- newPI.BottomSurface = Enum.SurfaceType.Smooth
- newPI.Anchored = true
- end
- newP(-47,.4,-11,16,1,16,"Mint","Fabric",0) --Floor
- --Doorway and outside wall
- newP(-38.6,5.25,-16.25,.8,10.7,5.5,"Pastel brown","Wood",0)
- newP(-38.6,5.25,-5.75,.8,10.7,5.5,"Pastel brown","Wood",0)
- newP(-38.6,.4,-11,.8,1,5,"Pastel brown","Wood",0)
- newP(-38.6,9.15,-11,.8,2.9,5,"Pastel brown","Wood",0)
- --Other outside walls
- newP(-46.6,5.25,-2.6,16.8,10.7,.8,"Pastel brown","Wood",0)
- newP(-55.4,5.25,-11,.8,10.7,17.6,"Pastel brown","Wood",0)
- --Window wall
- newP(-46.6,1.95,-19.4,16.9,4.1,.8,"Pastel brown","Wood",0)
- newP(-41.6,5.75,-19.4,6.8,3.5,.8,"Pastel brown","Wood",0)
- newP(-53.6,5.75,-19.4,2.8,3.5,.8,"Pastel brown","Wood",0)
- newP(-46.6,9.05,-19.4,16.8,3.1,.8,"Pastel brown","Wood",0)
- newP(-48.6,5.75,-19.35,7.2,3.5,.7,"Pastel light blue","Smooth plastic",.6)
- --Roof (Might be removed and replaced with upper story later!)
- newP(-47,11.05,-11,17.6,.9,17.6,"Pastel brown","Wood",0)
- newP(-47,10.55,-11,16,.1,16,"White","Smooth plastic",0)
- --Interior walls
- newP(-46.65,9.05,-18.95,16.7,3.1,.1,"Pastel green","Smooth plastic",0)
- newP(-41.65,5.75,-18.95,6.7,3.5,.1,"Pastel green","Smooth plastic",0)
- newP(-53.6,5.75,-18.95,2.8,3.5,.1,"Pastel green","Smooth plastic",0)
- newP(-46.65,1.95,-18.95,16.7,4.1,.1,"Pastel green","Smooth plastic",0)
- newP(-54.95,5.25,-11,.1,10.7,17.4,"Pastel green","Smooth plastic",0)
- newP(-46.6,5.25,-3.05,16.6,10.7,.1,"Pastel green","Smooth plastic",0)
- newP(-39.05,5.25,-5.75,.1,10.8,5.5,"Pastel green","Smooth plastic",0)
- newP(-39.05,5.25,-16.25,.1,10.7,5.5,"Pastel green","Smooth plastic",0)
- newP(-39.05,9.15,-10.95,.1,3,5.1,"Pastel green","Smooth plastic",0)
- --Bed
- newP(-49.15,.95,-6.2,9.7,.3,4.6,"Maroon","Fabric",0)
- newP(-52.45,1.2,-6.2,2.3,.4,3.4,"White","Sand",0)
- --Bin
- newP(-43.86,2.6,-16.639,.2,3.4,3.7,"Ghost grey","Concrete",0)
- newP(-41.76,2.6,-14.889,4,3.4,.2,"Ghost grey","Concrete",0)
- newP(-39.66,2.6,-16.639,.2,3.4,3.7,"Ghost grey","Concrete",0)
- newP(-41.76,2.6,-18.389,4,3.4,.2,"Ghost grey","Concrete",0)
- newP(-41.76,1.05,-16.639,4,.3,3.3,"Ghost grey","Concrete",0)
- --Bin contents
- basketball = Instance.new("Part",model)
- adjustP(basketball,-40.5,1.7,-17.5,1.5,1.5,1.5,"Medium stone grey","Plastic",0)
- basketball.Shape = Enum.PartType.Ball
- basketball.Anchored = false
- basketballM = Instance.new("SpecialMesh",basketball)
- basketballM.MeshType = "FileMesh"
- basketballM.MeshId = "rbxassetid://430345698"
- basketballM.TextureId = "rbxassetid://430345777"
- basketballM.Scale = Vector3.new(.06,.06,.06)
- basketball2 = Instance.new("Part",model)
- adjustP(basketball2,-40.5,3.3,-17.5,1.5,1.5,1.5,"Medium stone grey","Plastic",0)
- basketball2.Shape = Enum.PartType.Ball
- basketball2.Anchored = false
- basketballM2 = Instance.new("SpecialMesh",basketball)
- basketballM2.MeshType = "FileMesh"
- basketballM2.MeshId = "rbxassetid://430345698"
- basketballM2.TextureId = "rbxassetid://430345777"
- basketballM2.Scale = Vector3.new(.06,.06,.06)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement