Why is this still dropping a regular part instead of a cylinder part?

Hello Devforum,
In an earlier post, I wasn’t sure if it was possible to make a dropper that drops a cylinder part. However, I am still not sure I can implement my new script. This is the current script that I have as the dropper script. It is dropping a regular part instead of a cylinder part.

local part = script.Parent
local newpart = part:Clone()
newpart.Shape = Enum.PartType.Cylinder

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

while true do
    wait(1.5)
    part.BrickColor= BrickColor.new("Black")
    part.Material= "CorrodedMetal"
    local cash = Instance.new("IntValue",part)
    cash.Name = "Cash"
    cash.Value = 5 
    part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.5,0)
    part.FormFactor = "Cylinder"
    part.Size=Vector3.new(1.5, 1.5, 1.5)
    part.TopSurface = "SmoothPlastic"
    part.BottomSurface = "SmoothPlastic"
    game.Debris:AddItem(part,20) 
end

Earlier Post: Is it possible to make a dropper that drops cylinder parts?

Thanks for reading,
Jackoob_YT

1 Like

Hm, I don’t know. It should work, try create an another part with cylinder shape and copy it.

I believe your problem is that you are using the reference part to do all the modifications, instead of using the newly created one.

Try changing to this, and let me know what happens:

local part = script.Parent

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

while true do
    wait(1.5)
    local newpart = part:Clone()
    newpart.Shape = Enum.PartType.Cylinder
    newpart.BrickColor= BrickColor.new("Black")
    newpart.Material= "CorrodedMetal"
    local cash = Instance.new("IntValue",newpart)
    cash.Name = "Cash"
    cash.Value = 5 
    newpart.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.5,0)
    newpart.Parent = part.Parent
    newpart.Size=Vector3.new(1.5, 1.5, 1.5)
    newpart.TopSurface = "SmoothPlastic"
    newpart.BottomSurface = "SmoothPlastic"
    game.Debris:AddItem(newpart,20) 
end

Edit: Wrong reply, should have been directed to @Jackoob_YT , apologies!

1 Like

FormFactor is not a property, you actually want the Shape property. (I think FormFactor is the name of the Enum so I see where you’re getting that from, its confusing)

Make sure you enable your output in View so you can see errors, it should say something like FormFactor is not a valid member of Part.

I would also suggest using Enums instead of strings since strings are a little slower but really mainly because it means if you type the wrong Enum for a part you get an error in the output that tells you what went wrong. Plus, typing out the enum gives you autocompletes so you can use Tab and and things like that.

1 Like

i found a problem with the cframes where you minus a cframe with a vector3 which wont work

part.FormFactor = “Cylinder”

FormFactor is very old, deprecated, and no longer works. Please do not use it. I think you meant to put part.Shape instead.

FormFactor was used to determine the minimum size constraint of given axis’s

1 Like

and also youre changing the part instead of the newpart

@Jackoob_YT here is the fixed script

local part = script.Parent

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

while true do
	wait(1.5)
	local newpart = part:Clone()
	newpart.Shape = Enum.PartType.Cylinder
	newpart.BrickColor= BrickColor.new("Black")
	newpart.Material= Enum.Material.CorrodedMetal
	newpart.Parent = workspace:WaitForChild("PartStorage")
	local cash = Instance.new("IntValue",newpart)
	cash.Name = "Cash"
	cash.Value = 5 
	newpart.CFrame = script.Parent.Drop.CFrame * CFrame.new(0,-1.75,0)
	newpart.Size=Vector3.new(1.5, 1.5, 1.5)
	game.Debris:AddItem(part,20) 
end
1 Like

Be careful, your script will not work:

After you delete the part, this line will throw an exception:

Moreover, you stated something that is in fact wrong:

Check the wiki out: CFrame

Try to make sure what you write works and is true, otherwise you might disorient people by misinforming them. :stuck_out_tongue:

Apart from that, you did very well!

1 Like

im sorry about that i never realised all this plus i learned many new stuff!!

1 Like