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

Change Tycoon Drop Shape? (Mesh/Object)

Hi, I am very new to scripting, but I really want to get good at it. I have been following a tutorial on Youtube for making a simple Tycoon. But I have come to the point where I want to change the drop shape from a cube to a Potato. Here is the script running at the moment, I have looked at other scripts for dropping swords and hats, but I can get it to work, please help. It would be great if you could take the script add add on the part with the Potato. Also, heres the potato ID: http://www.roblox.com/asset/?id=81684482 Thanks in advanced.

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

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

2 answers

✓ Accepted answer

insert a mesh part into the part

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

while true do
    wait(4.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 mesh = Instance.new("SpecialMesh")
            mesh.Parent = part
            mesh.MeshType = "FileMesh"
            mesh.MeshId = "rbxassetid://81684482"
    local cash = Instance.new("IntValue",part)
    cash.Name = "Cash"
    cash.Value = 100 -- How much the drops are worth
    part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.6,0)
    part.FormFactor = "Custom"
    part.Size=Vector3.new(1.4, 1.4, 1.4) -- Size of the drops
    part.TopSurface = "Smooth"
    part.BottomSurface = "Smooth"
    game.Debris:AddItem(part,20) -- How long until the drops expire

end


this should work now. if it doesnt. tell me and i'll test it again.

i tested it with this script

 local part = Instance.new("Part",workspace.PartStorage)
            part.BrickColor= game.Workspace.DropColor.Value
            part.Material=game.Workspace.MaterialValue.Value
            local mesh = Instance.new("SpecialMesh")
            mesh.Parent = part
            mesh.MeshType = "FileMesh"
            mesh.MeshId = "rbxassetid://81684482"

7 comments

0

Thanks! Will try

0

It works!!!! Now I just need to make them larger haha, thanks!

0

no problem as with the size, good luck :)

0

Yeah... ah.... how do I change the size? XD

0

put "mesh.Scale = Vector3.new(4,4,4)" anywhere in the mesh part of the script (lines 9 -12)

0

never mind! I figured it out, just had to use "scale", instead of "size". Awesome! Thanks afain, I will give you credit in the discription of the game. heres the link to it if you wanna check it out aha. https://www.roblox.com/games/563743556/Potato-Tycoon

0

accept my answer if you figured it out :3

Right, so I did that, but, it still doesn't work.

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 mesh = Instance.new("SpecialMesh")
			mesh.Parent = part
			mesh.MeshType = "FileMesh"
			mesh.MeshId = "rbxassetid://81684482"
			mesh.TexureId = "rbxassetid://81684482"
			local cash = Instance.new("IntValue",part)
			cash.Name = "Cash"
			cash.Value = 1 -- How much the drops are worth
			part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)
			part.FormFactor = "Custom"
			part.Size=Vector3.new(1, 1, 1) -- Size of the drops
			part.TopSurface = "Smooth"
			part.BottomSurface = "Smooth"
			game.Debris:AddItem(part,20) -- How long until the drops expire
			wait(.15)
			deb = true
	end
end)

2 comments

0

my bad i missed a T. but i changed the script and fixed it

0

Okay, thanks again! aha

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