Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Script for a MeshPart Dropper?

I'm trying to make a tycoon game and am using this code for a dropper. What is the best way to modify this script to use MeshParts with a specific Mesh / Texture ID instead? (original script from Zednov's Tycoon Kit)

while true do
	wait(1.5) -- How long in between drops
	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 -- How much the drops are worth
	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) -- Size of the drops
	part.TopSurface = "Smooth"
	part.BottomSurface = "Smooth"
	game.Debris:AddItem(part,20) -- How long until the drops expire
end

1 comment

0

As far as I know, Zednov's tycoon kit was made like 8 years ago and is severely outdated, unless someone took the time to update it. I don't recommend using it for an actual game, maybe just to learn from. But thats up to you. Regardless, replace Instance.New("Part") with Instance.New("MeshPart") And then you can part.MeshId = ID, part.TextureId = ID, etc

1 answer

Well, I tried this, but that just outputs a blank MeshPart with no model or texture ONCE. It doesn't drop another MeshPart after the set time period.

while true do
	wait(1.5) -- How long in between drops
	local part = Instance.new("MeshPart",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 -- How much the drops are worth
	part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
	part.FormFactor = "Custom"
	part.Size = Vector3.new(4, 1, 4) -- Size of the drops
	part.MeshId = 6148775360
	part.TextureId = 4916133304
	game.Debris:AddItem(part,20) -- How long until the drops expire
end

This discussion is preserved as it was. New answers, comments, and votes are closed.