Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tycoon dropping meshes instead of parts?

Asked by
123bbz 0
8 years ago

Hi, I'm currently working on a tycoon project and I would like assistance with transforming this script to be able to drop meshes instead of parts, all help is greatly appreciated! Thanks :).

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

while true do
    wait(1.5)
    local part = Instance.new("Part",workspace.PartStorage)
    part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
    part.Material=script.Parent.Parent.Parent.MaterialValue.Value
    local Robux = Instance.new("IntValue",part)
    Robux.Name = "Robux"
    Robux.Value = 2
    part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
    part.FormFactor = "Custom"
    part.Size=Vector3.new(2, 0.2, 0.8)
    part.TopSurface = "Smooth"
    part.BottomSurface = "Smooth"
    game.Debris:AddItem(part,20)
end

2 answers

Log in to vote
1
Answered by
yoshi8080 445 Moderation Voter
8 years ago
wait(2)
workspace:WaitForChild("PartStorage")

    while wait(1.5) do -- I would recommend using `while wait() do` loop for this to happen every 1.5 secs
-- part properties
    local part = Instance.new("Part",workspace.PartStorage)
        part.BrickColor=script.Parent.Parent.Parent.DropColor.Value
        part.Material=script.Parent.Parent.Parent.MaterialValue.Value
        part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0)
        part.FormFactor = "Custom"
        part.Size = Vector3.new(2, 0.2, 0.8)
        part.TopSurface = "Smooth"
        part.BottomSurface = "Smooth"
-- mesh
        local mesh = Instance.new('SpecialMesh',part)  -- Adds the mesh to the part
        mesh.MeshType = 'FileMesh'
        mesh.MeshId = '' -- id of mesh
        mesh.TextureId = '' -- texture id
        mesh.Scale = Vector3.new(1,1,1) -- how big you want the mesh to be
-- robux
    local Robux = Instance.new("IntValue",part)
        Robux.Name = "Robux"
        Robux.Value = 2
        game.Debris:AddItem(part,20)
end
Ad
Log in to vote
0
Answered by 8 years ago
local mesh = Instance.new("Mesh")
mesh.MeshId = "" --Your mesh here
mesh.Parent = part

Answer this question