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

The resizing through the script is not working?

I am using this code from my dropper

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



meshDrop = true
--------------------
-- Mesh Settings: -- [If you want a mesh drop, set meshDrop to true up on top.]
-- Look at the mesh properties and change the inside of the quotes below to the appropriate
-- full link or the rbxasset:// style, doesnt matter which one you see in the mesh you want

meshID = "rbxassetid://5218007939"  
textureID = "rbxasset://textures/PaintballGunTex128.png"
--------------------


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,0)
	part.FormFactor = "Custom"
	part.Size=Vector3.new(1,1,1) -- Size of the drops
	if meshDrop == true then
	local m = Instance.new("SpecialMesh",part)
	m.MeshId = meshID
	m.TextureId = textureID
	end
	part.TopSurface = "Smooth"
	part.BottomSurface = "Smooth"
	game.Debris:AddItem(part,20) -- How long until the drops expire
end

the "part.Size=Vector3.new(1,1,1)" is actually doesn't affect anyhow on the size. Any ideas how to resize?

1 comment

0

I do not recommend using the 2nd parameter of Instance.new() as it is deprecated. Try separating the part.Size=Vector3.new().

1 answer

✓ Accepted answer

Mesh instances applied to parts do not actually have an effect based on the part it's size. A SpecialMesh has a separate property called Scale which is used to upsize/downsize the mesh.

However there are also MeshParts, these do exactly what a Part + SpecialMesh do and the size of the mesh is actually determined based on the part it's size. You are better off using these instances.

1 comment

0

Thanks you! I will use "MeshPart" instead of SpecialMesh :D

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