Tycoon Dropper Help

Hi, so i’m working on a tycoon and i’m using Zed’s Tycoon Kit and i was wondering if its possible to make it drop Dummy rigs or Models like the one below.

I have tried so many solutions and have looked everywhere online and nothing seems to work so my last resort is the experts.

Dropper Script:

wait(2)

workspace:WaitForChild("PartStorage")

while true do

wait(1.5) 

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 = 5 

part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)

part.FormFactor = "Custom"

part.Size=Vector3.new(1.2, 1.2, 1.2)

part.TopSurface = "Smooth"

part.BottomSurface = "Smooth"

game.Debris:AddItem(part,20)

end

Well, you would have it clone the model and use SetPrimaryPartCFrame.

wait(2)

workspace:WaitForChild("PartStorage")

while true do

wait(1.5) 

local dummy = --path to the dummy, or you can change dummy on the next line
local model = dummy:Clone()

local cash = Instance.new("IntValue", dummy)

cash.Name = "Cash"

cash.Value = 5 

part:SetPrimaryPartCFrame(script.Parent.Drop.CFrame - Vector3.new(0,1.4,0))

game.Debris:AddItem(model,20)

end

You may have to look out for the dummy getting stuck depending on the dropper size, though.

1 Like

Yes i believe i tried this and just got lost on the SetPrimaryPartCFrame situation is there any possible way you could show me how this works?

You take the Dummy Model and call :SetPrimaryPartCFrame which positions the parts of a rig (in this case its your Dummy) correctly to a CFrame. So just follow along @Kaid3n22 's code but replace the part at this line:

part:SetPrimaryPartCFrame(script.Parent.Drop.CFrame - Vector3.new(0,1.4,0))

with dummy so its

dummy:SetPrimaryPartCFrame(script.Parent.Drop.CFrame - Vector3.new(0,1.4,0))

i think he forgot that idk

if your dummy does not have a PrimaryPart (it’s a property) set it to the HumanoidRootPart of the dummy

1 Like

Yeah :sweat_smile: I forgot to change the part to dummy there. Thank you for correcting that.

1 Like

This has worked but there is 1 issue that i’m facing.

  1. They drop out the dropper fine but the issue is they don’t make it to the sell point its like they just vanish and replace them self’s at the dropper.

Could you send a video of it happening

Add a wait() with a few seconds inbetween the lines with setprimarypartcframe() and game.debris:additem()

Also disable the collisions of the dummy

Can you send the script? It looks like you’re not cloning the dummy, so its just using a single dummy over and over again, which means you need to add :Clone() at the end of the line where you get the dummy.

So this worked but they don’t sell now any idea on why that is.

Also they seem to stand on the conveyor like seen below, is there any way of making them just flat?

image

wait(2)

workspace:WaitForChild("PartStorage")

while true do

	wait(1.5) 

	local dummy = game.Workspace.Dummy--path to the dummy, or you can change dummy on the next line
	local model = dummy:Clone()

	local cash = Instance.new("IntValue", dummy)

	cash.Name = "Cash"

	cash.Value = 5 

	dummy:SetPrimaryPartCFrame(script.Parent.Drop.CFrame - Vector3.new(0,1.5,0))
	
	wait(6)

	game.Debris:AddItem(model,20)

end

You’re moving the dummy instead of the model, use this script instead.

You should also move the dummy to ReplicatedStorage instead of Workspace.

while true do
	wait(1.5) 

	local dummy = game.ReplicatedStorage.Dummy--path to the dummy, or you can change dummy on the next line
	local model = dummy:Clone()

	local cash = Instance.new("IntValue", model)
	cash.Name = "Cash"
	cash.Value = 5 

	model:SetPrimaryPartCFrame(script.Parent.Drop.CFrame - Vector3.new(0,1.5,0))
	model.Parent = workspace.PartStorage

	game.Debris:AddItem(model,20)
end

again this work but i’m still having the same issue that i posted above where they don’t sell plus they seem to stand also when im hoping to make them flat

image

They’re probably standing because it has a Humanoid inside it, you should remove the Humanoid because of that, but also because it’ll cause a lot of lag. Only problem is it’ll mess up the visuals of the character.

Selling not working is probably because the sell script is looking for a part and not a model. You need to add some checks to the selling script to fix this, send the sell script.

I think this might be it, if not let me know ill keep looking.

	for i,v in pairs(script.Parent.Essentials:GetChildren()) do
		if v.Name == "PartCollector" then
			v.Touched:connect(function(Part)
				if Part:FindFirstChild('Cash') then
					Money.Value = Money.Value + Part.Cash.Value
					Debris:AddItem(Part,0.1)
				end
			end)
		end
	end

This is just a part of the script the full script is here:

	--[[
		All configurations are located in the "Settings" Module script.
		Please don't edit this script unless you know what you're doing.
	--]]
	local Objects = {}
	local TeamColor = script.Parent.TeamColor.Value
	local Settings = require(script.Parent.Parent.Parent.Settings)
	local Money = script.Parent.CurrencyToCollect
	local Debris = game:GetService('Debris')
	local Stealing = Settings.StealSettings
	local CanSteal = false -- don't change or else you won't be able to steal currency
	
	script.Parent.Essentials.Spawn.TeamColor = TeamColor
	script.Parent.Essentials.Spawn.BrickColor = TeamColor
	
	function Sound(part,id)
		if part:FindFirstChild('Sound') then
			return
		else
			local Sound = Instance.new('Sound',part)
			Sound.SoundId = "rbxassetid://"..tostring(id)
			Sound:Play()
			delay(Sound.TimeLength, function()
				Sound:Destroy()
			end)
		end
	end
	
	--Parts that fall into the collector(s) get processed
	for i,v in pairs(script.Parent.Essentials:GetChildren()) do
		if v.Name == "PartCollector" then
			v.Touched:connect(function(Part)
				if Part:FindFirstChild('Cash') then
					Money.Value = Money.Value + Part.Cash.Value
					Debris:AddItem(Part,0.1)
				end
			end)
		end
	end
	
	--Player Touched Collector processor
	deb = false
	script.Parent.Essentials.Giver.Touched:connect(function(hit)
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		if player ~= nil then
			if script.Parent.Owner.Value == player then
				if hit.Parent:FindFirstChild("Humanoid") then
					if hit.Parent.Humanoid.Health > 0 then
						if deb == false then
							deb = true
							script.Parent.Essentials.Giver.BrickColor = BrickColor.new("Bright red")
							local Stats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
							if Stats ~= nil then 
							Sound(script.Parent.Essentials, Settings.Sounds.Collect)
							Stats.Value = Stats.Value + Money.Value
							Money.Value = 0
							wait(1)
							script.Parent.Essentials.Giver.BrickColor = BrickColor.new("Sea green")
							deb = false
							end
						end
					end
				end
			elseif Stealing.Stealing then -- if player isn't owner and stealing is on
				if CanSteal == true then
					CanSteal = false
					delay(Stealing.PlayerProtection, function()
						CanSteal = true
					end)
					if hit.Parent:FindFirstChild("Humanoid") then
						if hit.Parent.Humanoid.Health > 0 then
							local Stats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
							if Stats ~= nil then
								local Difference = math.floor(Money.Value * Stealing.StealPrecent)
								Sound(script.Parent.Essentials, Settings.Sounds.Collect)
								Stats.Value = Stats.Value + Difference
								Money.Value = Money.Value - Difference
							end
						end
					end
				else
					Sound(script.Parent.Essentials, Settings.Sounds.Error)
				end
			end
		end
	end)
	
	script.Parent:WaitForChild("Buttons")
	for i,v in pairs(script.Parent.Buttons:GetChildren()) do
		spawn(function()
		if v:FindFirstChild("Head") then
			
			local ThingMade = script.Parent.Purchases:WaitForChild(v.Object.Value)
			if ThingMade ~= nil then
				Objects[ThingMade.Name] = ThingMade:Clone()
				ThingMade:Destroy()
			else
				--//Button doesn't have object, remove it
				error('Object missing for button: '..v.Name..', button has been removed')
				v.Head.CanCollide = false
				v.Head.Transparency = 1
			end
									
			if v:FindFirstChild("Dependency") then --// if button needs something unlocked before it pops up
				v.Head.CanCollide = false
				v.Head.Transparency = 1
				coroutine.resume(coroutine.create(function()
					if script.Parent.PurchasedObjects:WaitForChild(v.Dependency.Value) then
						if Settings['ButtonsFadeIn'] then
							for i=1,20 do
								wait(Settings['FadeInTime']/20)
								v.Head.Transparency = v.Head.Transparency - 0.05
							end
						end
						v.Head.CanCollide = true
						v.Head.Transparency = 0
					end
				end))
			end
			
			v.Head.Touched:connect(function(hit)
				local player = game.Players:GetPlayerFromCharacter(hit.Parent)
				if v.Head.CanCollide == true then
					if player ~= nil then
						if script.Parent.Owner.Value == player then
							if hit.Parent:FindFirstChild("Humanoid") then
								if hit.Parent.Humanoid.Health > 0 then
									local PlayerStats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
									if PlayerStats ~= nil then
										if (v:FindFirstChild('Gamepass')) and (v.Gamepass.Value >= 1) then
											if game:GetService("MarketplaceService"):PlayerOwnsAsset(player,v.Gamepass.Value) then
												Purchase({[1] = v.Price.Value,[2] = v,[3] = PlayerStats})
											else
												game:GetService('MarketplaceService'):PromptPurchase(player,v.Gamepass.Value)
											end
										elseif (v:FindFirstChild('DevProduct')) and (v.DevProduct.Value >= 1) then
											game:GetService('MarketplaceService'):PromptProductPurchase(player,v.DevProduct.Value)
										elseif PlayerStats.Value >= v.Price.Value then
											Purchase({[1] = v.Price.Value,[2] = v,[3] = PlayerStats})
											Sound(v, Settings.Sounds.Purchase)
										else
											Sound(v, Settings.Sounds.ErrorBuy)
										end
									end
								end
							end
						end
					end
				end
			end)
			end
		end)
	end
	
	function Purchase(tbl)
		local cost = tbl[1]
		local item = tbl[2]
		local stats = tbl[3]
		stats.Value = stats.Value - cost
		Objects[item.Object.Value].Parent = script.Parent.PurchasedObjects
		if Settings['ButtonsFadeOut'] then
			item.Head.CanCollide = false
			coroutine.resume(coroutine.create(function()
				for i=1,20 do
					wait(Settings['FadeOutTime']/20)
					item.Head.Transparency = item.Head.Transparency + 0.05
				end
			end))
		else
			item.Head.CanCollide = false
			item.Head.Transparency = 1
		end
	end
	
	function Create(tab)
		local x = Instance.new('Model')
		Instance.new('NumberValue',x).Value = tab[1]
		x.Value.Name = "Cost"
		Instance.new('ObjectValue',x).Value = tab[2]
		x.Value.Name = "Button"
		local Obj = Instance.new('ObjectValue',x)
		Obj.Name = "Stats"
		Obj.Value = tab[3]
		x.Parent = script.Parent.BuyObject
	end
	
	--// This was very rushed and is inefficent; if you plan on making something like this don't use a child added listener.
	script.Parent:WaitForChild('BuyObject').ChildAdded:connect(function(child)
		local tab = {}
		tab[1] = child.Cost.Value
		tab[2] = child.Button.Value
		tab[3] = child.Stats.Value
		Purchase(tab)
		wait(10)
		child:Destroy()
	end)

Yeah thats it, basically we just need to add a check for if we find Cash in the parent, since the Part of the Touched event will be a limb of the model, not the model itself.

	for i,v in pairs(script.Parent.Essentials:GetChildren()) do
		if v.Name == "PartCollector" then
			v.Touched:connect(function(Part)
				if Part:FindFirstChild('Cash') then
					Money.Value = Money.Value + Part.Cash.Value
					Debris:AddItem(Part,0.1)
                elseif Part.Parent:FindFirstChild("Cash") then
                    Money.Value += Part.Parent.Cash.Value --+= is faster to type and works exactly the same
                    Debris:AddItem(Part.Parent, 0.1)
				end
			end)
		end
	end

Ill i give it a few try’s and ill let you know how it goes

Works Perfect Thanks for the help
@KdudeDev
@Kaid3n22
@Dyzody

1 Like