generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: House Help 2

Previous Thread :: Next Thread 
naby441 is not online. 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 is not online. naby441
Joined: 21 Nov 2012
Total Posts: 186
17 Feb 2015 07:05 PM
B1


Naby. - Mhm, that's me!
Report Abuse
naby441 is not online. naby441
Joined: 21 Nov 2012
Total Posts: 186
17 Feb 2015 07:15 PM
B2


Naby. - Mhm, that's me!
Report Abuse
buildmodel is not online. buildmodel
Joined: 17 Jul 2012
Total Posts: 3778
17 Feb 2015 07:24 PM
Did you get that from free models?
Report Abuse
naby441 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image