|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 May 2014 04:05 PM |
bump
Yeah, I see nothing wrong in my script. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 04 May 2014 04:46 PM |
| Brick2 should be in Tycoon>Factory and the buttens should be in there too. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 04 May 2014 04:50 PM |
@late Both of them are in Factory. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
| |
|