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
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"
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)