Advertisement
Guest User

Untitled

a guest
Jan 26th, 2015
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.69 KB | None | 0 0
  1. par = script.Parent
  2. plr = game.Players.LocalPlayer
  3. repeat wait() until #par:GetChildren() >= 8 and plr:FindFirstChild("Config") ~= nil
  4. con = plr:WaitForChild("Config")
  5. houseVal = 1
  6.  
  7. function Update()
  8. if con:FindFirstChild("House") and con.House.Value == houseVal then
  9. par['Owner Frame'].Position = UDim2.new(1,0,0,0)
  10. par['For Sale']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
  11. par['Owner Frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  12. par['Purchase Page']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
  13. par['You already own a house frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
  14. elseif con.House.Value ~= houseVal and con.House.Value ~= 0 then
  15. par['Purchase Page']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
  16. par['For Sale']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
  17. par['Owner Frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
  18. par['You already own a house frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  19. else
  20. par['Sell Frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
  21. par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  22. par['You already own a house frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
  23. end
  24. end
  25.  
  26. par['For Sale']['For Sale Frame'].MouseButton1Click:connect(function()
  27. par['Purchase Page'].Position = UDim2.new(1,0,0,0)
  28. par['Purchase Page']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  29. par['For Sale']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
  30. end)
  31.  
  32. par['Purchase Page'].CANCEL.MouseButton1Click:connect(function()
  33. par['Purchase Page']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
  34. par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  35. end)
  36.  
  37. par['Purchase Page'].PURCHASE.MouseButton1Click:connect(function()
  38. if con.Veza.Value >= par.Parent.Price.Value then
  39. local d = Workspace.ChangeValue:InvokeServer("Veza",con.Veza.Value-par.Parent.Price.Value)
  40. local d = Workspace.ChangeValue:InvokeServer("House",houseVal)
  41. else
  42. par['Insufficient funds']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  43. par['Purchase Page']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
  44. wait(5)
  45. par['Insufficient funds']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
  46. par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  47. end
  48. end)
  49.  
  50. par['Owner Frame'].SELL.MouseButton1Click:connect(function()
  51. par['Sell Frame'].Position = UDim2.new(1,0,0,0)
  52. par['Sell Frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  53. par['Owner Frame']:TweenPosition(UDim2.new(-1,0,0,0),1,3,1,true)
  54. end)
  55.  
  56. par['Sell Frame'].CANCEL.MouseButton1Click:connect(function()
  57. par['Owner Frame'].Position = UDim2.new(-1,0,0,0)
  58. par['Owner Frame']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  59. par['Sell Frame']:TweenPosition(UDim2.new(1,0,0,0),1,3,1,true)
  60. end)
  61.  
  62. local debounce = false
  63. par['Sell Frame'].SELL.MouseButton1Click:connect(function()
  64. if not debounce then
  65. debounce = true
  66. local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
  67. if house ~= nil then
  68. -- par['For Sale'].Position = UDim2.new(-1,0,0,0)
  69. -- par['For Sale']:TweenPosition(UDim2.new(0,0,0,0),1,3,1,true)
  70. for i, a in pairs(house:GetChildren()) do--Furniture removal
  71. local name = ""
  72. for ii in string.gmatch(a.Name, "%D+") do name = ii end--Remove #'s from name
  73. if game.ReplicatedStorage.Furniture:FindFirstChild(name) ~= nil then--Means it furniture
  74. Workspace.Destroyer:FireServer(con[a.Name])--Destroy from data
  75. local d = Workspace.ChangeValue:InvokeServer(name,con[name].Value+1)--Add to inventory
  76. end
  77. end
  78. local d = Workspace.ChangeValue:InvokeServer("House",0)
  79. local d = Workspace.ChangeValue:InvokeServer("Veza",con.Veza.Value+tonumber(script.Parent['Sell Frame']['Cost Frame']['Price goes here'].Text))
  80. Workspace.Destroyer:FireServer(house)
  81. end
  82. wait(3)
  83. debounce = false
  84. end
  85. end)
  86.  
  87. par['Owner Frame'].TELEPORT.MouseButton1Click:connect(function()
  88. local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
  89. fade = plr.PlayerGui['VENEZIA HUD'].HUD.FADE
  90. if house ~= nil then
  91. fade.TextLabel.Text = "Entering..."
  92. for i=1,-0.05,-0.05 do
  93. wait()
  94. fade.BackgroundTransparency = i
  95. fade.TextLabel.TextTransparency = i
  96. end
  97. dots = 0
  98. for i = 1,5 do
  99. if dots <= 2 then
  100. dots = dots + 1
  101. else
  102. dots = 1
  103. end
  104. if dots == 1 then
  105. fade.TextLabel.Text = "Entering."
  106. elseif dots == 2 then
  107. fade.TextLabel.Text = "Entering.."
  108. else
  109. fade.TextLabel.Text = "Entering..."
  110. end
  111. wait(1)
  112. end
  113. plr.Character:MoveTo(house.Teleport.Position)
  114. for i=0,1.05,0.05 do
  115. wait()
  116. fade.BackgroundTransparency = i
  117. fade.TextLabel.TextTransparency = i
  118. end
  119. end
  120. end)
  121.  
  122. script.Parent["Owner Frame"]:WaitForChild("LOCKED").MouseButton1Click:connect(function()
  123. local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
  124. local but = script.Parent["Owner Frame"].LOCKED
  125. if house ~= nil then
  126. local locked = Workspace.LockHouse:InvokeServer(house)
  127. if locked then
  128. but.Img.Image = "rbxassetid://120171685"
  129. but.BackgroundColor3 = Color3.new(1,0,0)
  130. but.Text = "CLOSED"
  131. but.TextColor3 = Color3.new(1,0,0)
  132. else
  133. but.Img.Image = "rbxassetid://120171723"
  134. but.BackgroundColor3 = Color3.new(0,1,0)
  135. but.Text = "OPENED"
  136. but.TextColor3 = Color3.new(0,1,0)
  137. end
  138. end
  139. end)
  140.  
  141. Update()
  142. con.House.Changed:connect(Update)
  143. local house = Workspace.Houses:FindFirstChild(plr.Name.."'s house")
  144. local but = script.Parent["Owner Frame"].LOCKED
  145. if house ~= nil then
  146. if locked then
  147. but.Img.Image = "rbxassetid://120171685"
  148. but.BackgroundColor3 = Color3.new(1,0,0)
  149. but.Text = "CLOSED"
  150. but.TextColor3 = Color3.new(1,0,0)
  151. else
  152. but.Img.Image = "rbxassetid://120171723"
  153. but.BackgroundColor3 = Color3.new(0,1,0)
  154. but.Text = "OPENED"
  155. but.TextColor3 = Color3.new(0,1,0)
  156. end
  157. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement