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

How can i make dropper who is dropping mesh?

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

while true do
	wait(1) -- 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 = 10 -- How much the drops are worth
	part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.75,0)
	part.FormFactor = "Custom"
	part.Size=Vector3.new(1.25, 1.7, 1.7) -- Size of the drops
	part.TopSurface = "Smooth"
	part.BottomSurface = "Smooth"
	game.Debris:AddItem(part,20) -- How long until the drops expire
end

Here is script for dropper on tycoon... how can i make dropper who is dropping part with mesh?

Proportions:

Mesh ID: 22147051 Texture ID: 2294843013

2 answers

hello, you can just copy/paste the mesh you want to drop.

local debris = game:GetService("Debris");
--// assuming that you've the mesh part on "ServerStorage".
local aPart = game:GetService("ServerStorage"):WaitForChild("Mesh");
local dropper = script.Parent.Drop;
local dropColor = script.Parent.Parent.Parent.DropColor.Value;
local dropMaterial = script.Parent.Parent.Parent.MaterialValue.Value;
local dropStorage = workspace.PartStorage;
while wait(1) do
	local dropPart= aPart:Clone();
	dropPart.Material = dropMaterial;
	dropPart.BrickColor = dropColor;
	dropPart.Anchored = false;
	dropPart.CanCollide = true;
	dropPart.CFrame = CFrame.new(dropper.CFrame.Position - Vector3.new(0,1.75,0));
	dropPart.Parent = dropStorage;
	local dropCash = Instance.new("IntValue",dropPart);
	dropCash.Name = "Cash";
	dropCash.Value = 10;
	debris:AddItem(bPart,20);
end

hope it helped.

1 comment

0

that's what i'd do if i tried to make that, if it's not the right way to do it then idk tbh.

Let me clear this up because you are failing to get a legitimate answer.

Regular Parts can have meshes inserted but it is simpler to use MeshParts. Example:

local part = Instance.new("MeshPart") -- Don't use the 2nd parameter, it causes lag
part.MeshId = 22147051
part.TextureID = 2294843013
part.BrickColor = script.Parent.Parent.Parent.DropColor.Value
part.Material = script.Parent.Parent.Parent.MaterialValue.Value
part.Parent = game.Workspace.PartStorage

What you can then do with this MeshPart is that you can set it to the rest of your script like so:

while true do -- Do NOT use while wait() do
    wait(1) -- How long in between drops
    local cash = Instance.new("IntValue")
    cash.Name = "Cash"
    cash.Value = 10 -- How much the drops are worth
    cash.Parent = part
    part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.75,0)
    part.FormFactor = "Custom"
    part.Size=Vector3.new(1.25, 1.7, 1.7) -- Size of the drops
    part.TopSurface = "Smooth"
    part.BottomSurface = "Smooth"
    game.Debris:AddItem(part,20) -- How long until the drops expire
end

Because MeshParts have the same properties as regular Parts, it is indeed possible to do all this. This is because MeshParts are actually cousins of Parts and the two Instances share properties.

Feel free to ask any questions you may have.

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