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

Change Tycoon Drop Shape? (Mesh/Object)

Asked by 7 years ago

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

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

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"
0
Thanks! Will try Pot8o_Penguin 50 — 7y
0
It works!!!! Now I just need to make them larger haha, thanks! Pot8o_Penguin 50 — 7y
0
no problem as with the size, good luck :) RobloxianDestory 262 — 7y
0
Yeah... ah.... how do I change the size? XD Pot8o_Penguin 50 — 7y
View all comments (3 more)
0
put "mesh.Scale = Vector3.new(4,4,4)" anywhere in the mesh part of the script (lines 9 -12) RobloxianDestory 262 — 7y
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 Pot8o_Penguin 50 — 7y
0
accept my answer if you figured it out :3 RobloxianDestory 262 — 7y
Ad
Log in to vote
1
Answered by 7 years ago

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)

0
my bad i missed a T. but i changed the script and fixed it RobloxianDestory 262 — 7y
0
Okay, thanks again! aha Pot8o_Penguin 50 — 7y

Answer this question