Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.Players.PlayerAdded:connect(function(player)
- local folder = Instance.new("Folder",player)
- folder.Name = "leaderstats"
- local cash = Instance.new("IntValue",folder)
- cash.Name = "Cash" -- My currency name will be "Cash"
- cash.Value = 5000 -- Starting money. 0 if you don't want
- end)
- --Now we're going to make the house buyable again when the owner left the game
- game.Players.PlayerRemoving:connect(function(player)
- if game.Workspace:FindFirstChild(player.Name.."'s House") then -- Checks if the player bought a house or not
- game.Workspace:FindFirstChild(player.Name.."'s House").Owner.Value = "" -- Change it back to normal
- game.Workspace:FindFirstChild(player.Name.."'s House"):FindFirstChild(player.Name.."'s House").Name = "Buy this house!" -- Change it back to normal
- game.Workspace:FindFirstChild(player.Name.."'s House").Door.CanCollide = true -- If the owner left and the door is opened, we're gonna close it
- game.Workspace:FindFirstChild(player.Name.."'s House").Door.Transparency = 0 -- Change it back to normal
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement