I am doing a Ice cream simulator, you get Ice cream Base, the cone That is the tool Handle, then a ball, How would i detect so if there’s not a ball Inside tool then Create a Ball Named “Ball” so if there’s already a Ball With that name then Creates another One with Name “Ball1” so I can set First Ball Position to Ball1 And Set The Y Pos 1 Stud Above, i tried this but it doesnt works (Max of balls is 3 btw)
local amountOfTimes = 0
function giveBall()
local ballpart = Instance.new("SpecialMesh", tool)
if amountOfTimes <= 0 and amountOfTimes <= 3 then
amountOfTimes += 1
ballpart.Name = amountOfTimes
end
if not tool:FindFirstChild("Cone"..amountOfTimes) then
ballpart.Name = "Cone"
ballpart.Position = tool.Handle.Position + Vector3.new(0,1,0)
else
ballpart.Position = Cone..amountOfTimes+ Vector3.new(0,1,0)
end
end