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: Help with a code (Tycoon, Limit)

Previous Thread :: Next Thread 
Kingofthehill4 is not online. Kingofthehill4
Joined: 05 Nov 2014
Total Posts: 97
08 Jul 2016 04:52 AM
What do i add to the script to limit the amount of ore drooped so it dost over fill

wait(2)
workspace:WaitForChild("PartStorage")


deb = true
script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
if deb == true then
deb = false
local part = Instance.new("Part",workspace.PartStorage)
part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
part.Material=script.Parent.Parent.Parent.MaterialValue.Value
local cash = Instance.new("IntValue",part)
cash.Name = "Cash"
cash.Value = 40
part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)
part.FormFactor = "Custom"
part.Size=Vector3.new(4, 4, 4)
part.TopSurface = "Smooth"
part.BottomSurface = "Smooth"
wait(.15)
deb = true
end
end)
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
08 Jul 2016 05:07 AM
Instead of creating tons of data, just use DebrisService, as it will remove those objects who have been associated with it after a set amount of time. Usually, set this to 30-60 seconds, so that they don't get deleted on the way to the end.


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
Report Abuse
Kingofthehill4 is not online. Kingofthehill4
Joined: 05 Nov 2014
Total Posts: 97
08 Jul 2016 05:10 AM
i cant do that because it is a Donation Truck for players to donate ore to over players But the truck can only hold 5/6 ore so i need to set the dropper to stop at 6 instead of it over filling and crating lag
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
08 Jul 2016 05:18 AM
So I'm getting a mixed idea of the situation. Is the dropper a separate dropper that's manual, or does ore get funneled to it too?


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
Report Abuse
Kingofthehill4 is not online. Kingofthehill4
Joined: 05 Nov 2014
Total Posts: 97
08 Jul 2016 05:53 AM
Join This Game >> https://www.roblox.com/games/449374894/NEW-House-Tycoon-New-Map-Bata-test you can get the Idea of what im doing from there
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
08 Jul 2016 06:14 AM
.Touched


Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
08 Jul 2016 06:29 AM
You could also use a Region3 call to find the parts in that area.


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
Report Abuse
Kingofthehill4 is not online. Kingofthehill4
Joined: 05 Nov 2014
Total Posts: 97
08 Jul 2016 06:41 AM
you mean?

bin = script.Parent
bin.One.Position = Vector3.new(1,10,10)
bin.Two.Position = Vector3.new(10,1,10)
bin.Three.Position = Vector3.new(10,10,1)
bin.Four.Position = Vector3.new(10,1,1)
bin.Five.Position = Vector3.new(1,1,10)
bin.Six.Position = Vector3.new(1,10,1)
bin.Seven.Position = Vector3.new(10,10,10)
bin.Eight.Position = Vector3.new(1,1,1)
Report Abuse
seanbenish is not online. seanbenish
Joined: 31 Jul 2009
Total Posts: 429
08 Jul 2016 06:45 AM
Naw, b/c roblox already has a built-in system for that.

local function IsMax(region,max)
if #workspace:FindPartsInRegion3(region,nil,max) >= max then
return true
else
return false
end
end

Define the region as on corner in the truck and the other as the opposite corner(in 3D space).


[Insert C++ statement here, b/c roblox doesn't allow it oVo]
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