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 » Scripting Helpers
Home Search
 

Re: Tycoon script is broken

Previous Thread :: Next Thread 
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 03:53 PM
So I'm making a tycoon, and I'm having a problem with one of the buttons. I don't know what is wrong, and it is confusing me. Can you guys help me?

Here's the script:

-------------------------------------------------------------------------------------------------------------------------
model = script.Parent.Parent.Parent.Parent.Brick2
Upgradecost = 150
-------------------------------------------------------------------------------------------------------------------------
upgradeStuff = model:clone()

wait(1)

model:remove()
owner = script.Parent.Parent.Parent.Parent.OwnerName
local ting = 0

function onTouched(hit)
if ting == 0 then
ting = 1
check = hit.Parent:FindFirstChild("Humanoid")

if check ~= nil then
if hit.Parent.Name == owner.Value then
local user = game.Players:GetPlayerFromCharacter(hit.Parent)
local stats = user:findFirstChild("leaderstats")

if stats ~= nil then
local cash = stats:findFirstChild("Cash")
if cash.Value > (Upgradecost-1) then

cash.Value = cash.Value - Upgradecost
upgradeStuff.Parent = script.Parent.Parent.Parent.Parent
script.Parent.Parent.Parent.Parent.Purchased.Item2.Value = true
script.Parent.Parent.Parent:remove()

end
end
end
end

ting = 0
end
end

script.Parent.Touched:connect(onTouched)


Here's the OutPut as well:
16:53:26.312 - Brick2 is not a valid member of Model
16:53:26.313 - Script 'Workspace.Tycoon1.Factory.Model2.Buy Brick2: 150.Head.Scrip', Line 2
16:53:26.314 - Stack End

(I'm not the world's best scripter, so, yeah.)
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 03:55 PM
"Brick2" is in the right place. This is the same as another button, except with some modifications.
The other button works, but this one doesn't, for some reason.
Report Abuse
bibo5o is not online. bibo5o
Joined: 17 Jan 2009
Total Posts: 414
04 May 2014 03:56 PM
I'm having problems like this as well. I may be blind or stupid, but I can't see anything wrong with my two scripts, and nor can I see anything wrong with yours.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 04:05 PM
bump

Yeah, I see nothing wrong in my script.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 04:21 PM
please help
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 04:35 PM
can anyone fix it?
Report Abuse
latefishingman is not online. latefishingman
Joined: 01 May 2011
Total Posts: 695
04 May 2014 04:46 PM
Brick2 should be in Tycoon>Factory and the buttens should be in there too.
Report Abuse
latefishingman is not online. latefishingman
Joined: 01 May 2011
Total Posts: 695
04 May 2014 04:48 PM
The script I use is the same and it works
And make sure you have caps where you need them.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 04:50 PM
@late
Both of them are in Factory.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 04:52 PM
I sort of modified the tycoon kit so that only button would appear at a time.
When you bought something, another button would appear, and so on.
Report Abuse
latefishingman is not online. latefishingman
Joined: 01 May 2011
Total Posts: 695
04 May 2014 04:53 PM
Then thats the problem. My tycoon is all buttens. just make the one they need to buy first cheaper.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 05:03 PM
Um, it's not like that.
It's in chronological order.
Let's say you were playing the tycoon.
You see one button, and you buy it.
Another one pops up that wasn't there before.

It goes like that, and uses an extremely crude script do it.
It worked for the income, but isn't doing that for the game.
Report Abuse
CoolJohnnyboy is not online. CoolJohnnyboy
Joined: 09 Mar 2010
Total Posts: 17699
04 May 2014 05:41 PM
Nevermind, I fixed it.
Report Abuse
JimmyChance is not online. JimmyChance
Joined: 01 Nov 2009
Total Posts: 3681
04 May 2014 06:07 PM
Tip for future, make a tycoon that runs under remote functions. An example is my Portal Tycoon.
Report Abuse
latefishingman is not online. latefishingman
Joined: 01 May 2011
Total Posts: 695
04 May 2014 07:04 PM
But good luck.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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