|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|