Advertisement
XxxLloyd061302xxX

Leaderboard for Buyable House Vid

Jul 5th, 2018
6,274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.04 KB | None | 0 0
  1. game.Players.PlayerAdded:connect(function(player)
  2.     local folder = Instance.new("Folder",player)
  3.     folder.Name = "leaderstats"
  4.     local cash = Instance.new("IntValue",folder)
  5.     cash.Name = "Cash" -- My currency name will be "Cash"
  6.     cash.Value = 5000 -- Starting money. 0 if you don't want
  7. end)
  8.  
  9. --Now we're going to make the house buyable again when the owner left the game
  10. game.Players.PlayerRemoving:connect(function(player)
  11.     if game.Workspace:FindFirstChild(player.Name.."'s House") then -- Checks if the player bought a house or not
  12.         game.Workspace:FindFirstChild(player.Name.."'s House").Owner.Value = "" -- Change it back to normal
  13.         game.Workspace:FindFirstChild(player.Name.."'s House"):FindFirstChild(player.Name.."'s House").Name = "Buy this house!" -- Change it back to normal
  14.         game.Workspace:FindFirstChild(player.Name.."'s House").Door.CanCollide = true -- If the owner left and the door is opened, we're gonna close it
  15.         game.Workspace:FindFirstChild(player.Name.."'s House").Door.Transparency = 0 -- Change it back to normal
  16.     end
  17. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement