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

I want to make these "Droppers" (Tycoon game) drop meshes instead of plain blocks, How?

Asked by
Cat348 0
8 years ago

It should take the mesh out of the script and apply it to the block, There are two dropper types, Manual click and auto, I've tried actually doing it myself but it just tends to break.

I'm also not sure how to make the part be right side up, (Tried to do part.rotation = (0,0,0) or something, but it also didn'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 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"
            wait(.15)
            deb = true
    end
end)
wait(2)
workspace:WaitForChild("PartStorage")

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.4,0)
    part.FormFactor = "Custom"
    part.Size=Vector3.new(1.2, 1.2, 1.2) -- Size of the drops
    part.TopSurface = "Smooth"
    part.BottomSurface = "Smooth"
end

1 answer

Log in to vote
0
Answered by 8 years ago
Edited 8 years ago

Hey, i think it should work with this script.

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

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 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
        local mesh = Instance.new("SpecialMesh", part)
        mesh.MeshType = "FileMesh"
        mesh.MeshId = ""
        mesh.TextureId = ""
        part.TopSurface = "Smooth"
        part.BottomSurface = "Smooth"
        wait(.15)
        deb = true
    end
end)

Also i think you have to change this line to make part on the right side:

part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)

I mean of course change numbers in Vector3.new(0,1.3,0) I hope it will help you.

Ad

Answer this question