Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- par = script.Parent
- plr = game.Players.LocalPlayer
- repeat wait() until #par:GetChildren() >= 8 and plr:FindFirstChild("Config") ~= nil
- con = plr:WaitForChild("Config")
- houseVal = 1
- function Update()
- if con:FindFirstChild("House") and con.House.Value == houseVal then
- par['Owner Frame'].Position = UDim2.new(1,0,0,0)
- par['For Sale']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
- par['Owner Frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- par['Purchase Page']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
- par['You already own a house frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
- elseif con.House.Value ~= houseVal and con.House.Value ~= 0 then
- par['Purchase Page']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
- par['For Sale']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
- par['Owner Frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
- par['You already own a house frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- else
- par['Sell Frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
- par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- par['You already own a house frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
- end
- end
- par['For Sale']['For Sale Frame'].MouseButton1Click:connect(function()
- par['Purchase Page'].Position = UDim2.new(1,0,0,0)
- par['Purchase Page']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- par['For Sale']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
- end)
- par['Purchase Page'].CANCEL.MouseButton1Click:connect(function()
- par['Purchase Page']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
- par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- end)
- par['Purchase Page'].PURCHASE.MouseButton1Click:connect(function()
- if con.Veza.Value >= par.Parent.Price.Value then
- local d = Workspace.ChangeValue:InvokeServer("Veza",con.Veza.Value-par.Parent.Price.Value)
- local d = Workspace.ChangeValue:InvokeServer("House",houseVal)
- else
- par['Insufficient funds']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- par['Purchase Page']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
- wait(5)
- par['Insufficient funds']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
- par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- end
- end)
- par['Owner Frame'].SELL.MouseButton1Click:connect(function()
- par['Sell Frame'].Position = UDim2.new(1,0,0,0)
- par['Sell Frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- par['Owner Frame']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
- end)
- par['Sell Frame'].CANCEL.MouseButton1Click:connect(function()
- par['Owner Frame'].Position = UDim2.new(-1,0,0,0)
- par['Owner Frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- par['Sell Frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
- end)
- local debounce = false
- par['Sell Frame'].SELL.MouseButton1Click:connect(function()
- if not debounce then
- debounce = true
- local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
- if house ~= nil then
- -- par['For Sale'].Position = UDim2.new(-1,0,0,0)
- -- par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
- for i, a in pairs(house:GetChildren()) do--Furniture removal
- local name = ""
- for ii in string.gmatch(a.Name, "%D+") do name = ii end--Remove #'s from name
- if game.ReplicatedStorage.Furniture:FindFirstChild(name) ~= nil then--Means it furniture
- Workspace.Destroyer:FireServer(con[a.Name])--Destroy from data
- local d = Workspace.ChangeValue:InvokeServer(name,con[name].Value+1)--Add to inventory
- end
- end
- local d = Workspace.ChangeValue:InvokeServer("House",0)
- local d = Workspace.ChangeValue:InvokeServer("Veza",con.Veza.Value+tonumber(script.Parent['Sell Frame']['Cost Frame']['Price goes here'].Text))
- Workspace.Destroyer:FireServer(house)
- end
- wait(3)
- debounce = false
- end
- end)
- par['Owner Frame'].TELEPORT.MouseButton1Click:connect(function()
- local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
- fade = plr.PlayerGui['VENEZIA HUD'].HUD.FADE
- if house ~= nil then
- fade.TextLabel.Text = "Entering..."
- for i=1,-0.05,-0.05 do
- wait()
- fade.BackgroundTransparency = i
- fade.TextLabel.TextTransparency = i
- end
- dots = 0
- for i = 1,5 do
- if dots <= 2 then
- dots = dots + 1
- else
- dots = 1
- end
- if dots == 1 then
- fade.TextLabel.Text = "Entering."
- elseif dots == 2 then
- fade.TextLabel.Text = "Entering.."
- else
- fade.TextLabel.Text = "Entering..."
- end
- wait(1)
- end
- plr.Character:MoveTo(house.Teleport.Position)
- for i=0,1.05,0.05 do
- wait()
- fade.BackgroundTransparency = i
- fade.TextLabel.TextTransparency = i
- end
- end
- end)
- script.Parent["Owner Frame"]:WaitForChild("LOCKED").MouseButton1Click:connect(function()
- local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
- local but = script.Parent["Owner Frame"].LOCKED
- if house ~= nil then
- local locked = Workspace.LockHouse:InvokeServer(house)
- if locked then
- but.Img.Image = "rbxassetid://120171685"
- but.BackgroundColor3 = Color3.new(1,0,0)
- but.Text = "CLOSED"
- but.TextColor3 = Color3.new(1,0,0)
- else
- but.Img.Image = "rbxassetid://120171723"
- but.BackgroundColor3 = Color3.new(0,1,0)
- but.Text = "OPENED"
- but.TextColor3 = Color3.new(0,1,0)
- end
- end
- end)
- Update()
- con.House.Changed:connect(Update)
- local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
- local but = script.Parent["Owner Frame"].LOCKED
- if house ~= nil then
- if locked then
- but.Img.Image = "rbxassetid://120171685"
- but.BackgroundColor3 = Color3.new(1,0,0)
- but.Text = "CLOSED"
- but.TextColor3 = Color3.new(1,0,0)
- else
- but.Img.Image = "rbxassetid://120171723"
- but.BackgroundColor3 = Color3.new(0,1,0)
- but.Text = "OPENED"
- but.TextColor3 = Color3.new(0,1,0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement