Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make an Ore Limit in Zonix's Simple Sandbox Tycoon Kit?

Asked by 2 years ago

I am using this kit > https://devforum.roblox.com/t/simple-sandbox-tycoon-kit/1488280 for a sandbox tycoon game like Miners Haven.

But...! There is no Ore Limit from what I can see. I know how to see how many children are in a folder called 'OreDrops' or something but how would I go about making a script where it stops droppers from dropping if it has reached MAX capacity? I would also like to add a script where you can upgrade it with money, etc. How would I do this and if you want to fix my code or something here you go:

local drops = game.Workspace.Plots.Plot1.MiscInfo.OresDropped:GetChildren()
local number = #children

print(number) 

This should print a number of how many children, so how do I use that for a OreLimit?

1 answer

Log in to vote
1
Answered by
AronYstad 101
2 years ago
Edited 2 years ago

"children" isn't defined. I am assuming you meant to put

local number = #drops

In the script that does the dropping, you could put the code mentioned above, and add this:

if #drops < MaxDrops then --Set MaxDrops to be whatever you want the maximum amount of drops to be
--put the dropping script here
end
1
I will accept your answer even though I fixed it myself :) Krektonix_Youtube 85 — 2y
Ad

Answer this question