naby441
|
  |
| Joined: 21 Nov 2012 |
| Total Posts: 186 |
|
|
| 17 Feb 2015 07:00 PM |
So, I have this house, and to buy it you need to own a certain amount of money. I was wondering, how can I remove that so, anyone can buy it, and they don't need a certain amount of money? Here's the script inside of the house that says you need to own a certain amount of money.
local ting = 0 --debouncer owner = script.Parent.Parent.Parent.OwnerName --This is the thing that holds the owners name function onTouched(hit) if ting == 0 then --debounce check ting = 1 --activate debounce local check = hit.Parent:FindFirstChild("Humanoid") --Find the human that touched the button if check ~= nil then --If a human is found, then local thisplr = game.Players:findFirstChild(hit.Parent.Name) if (thisplr~=nil) then local ownstyc = thisplr:findFirstChild("Tycoon") if (ownstyc~=nil) then
if ownstyc.Value == 0 then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats") local cash = stats:findFirstChild("Money") if cash.Value > 0 then --Change 999 to 1 number less than the original price(below) cash.Value = cash.Value -0 --Change 1000 to the price you want
local house = script.Parent.Parent.Parent.House
-- House Purchase ownstyc.Value = 1 owner.Value = thisplr.Name
house.DoorClose.Transparency = 1 house.DoorClose.CanCollide = false house.HandleClose.Transparency = 1
house.DoorOpen.Transparency = 0.1 house.HandleOpen.Transparency = 0
script.Parent.Parent.Parent.Add.Disabled = false
local message = Instance.new("Message") message.Text = "House Purchased!" message.Parent = thisplr.PlayerGui script.Parent.CanCollide = false script.Parent.Transparency = 1 wait(2) message:remove() script.Parent.Parent:remove() -- Purchase End else local message = Instance.new("Message") message.Text = "You do not have enough money." message.Parent = thisplr.PlayerGui wait(2) message:remove() end
elseif ownstyc.Value == 1 then local message = Instance.new("Message") message.Text = "You already own a house." message.Parent = thisplr.PlayerGui wait(2) message:remove() end end end end ting = 0 --remove debounce end end
script.Parent.Touched:connect(onTouched) --Start listening for button-touchers.
Naby. - Mhm, that's me! |
|
|
| Report Abuse |
|
|
naby441
|
  |
| Joined: 21 Nov 2012 |
| Total Posts: 186 |
|
| |
|
naby441
|
  |
| Joined: 21 Nov 2012 |
| Total Posts: 186 |
|
| |
|
|
| 17 Feb 2015 07:24 PM |
| Did you get that from free models? |
|
|
| Report Abuse |
|
|
naby441
|
  |
| Joined: 21 Nov 2012 |
| Total Posts: 186 |
|
|
| 17 Feb 2015 07:27 PM |
Well, yes. One of you guys told me try to find one from FM's and go that way, so I did.
Naby. - Mhm, that's me! |
|
|
| Report Abuse |
|
|
naby441
|
  |
| Joined: 21 Nov 2012 |
| Total Posts: 186 |
|
|
| 17 Feb 2015 07:27 PM |
Anyways can someone fix it?
Naby. - Mhm, that's me! |
|
|
| Report Abuse |
|
|